WinForms application not working

JetmansDad

New member
Joined
Jan 12, 2022
Messages
3
Programming Experience
5-10
Hi there,

I have thrown together a simple WinForms application using an Access database for data storage, and the progam seems to work well. However, if I try to run it on any machine other than one essentially identical to the one I wrote it on, it just doesn't work ... no crash, no exceptions thrown, just hit the icon, the wheel spins for a second or two and then nothing.

I have tried to run the program elsewhere by simply copying the files from the Release folder, and that works on any PC attached to the same network as the machine I wrote it one but nowhere else, and by creating an installer from VS2019 but both fail to run in exactly the same way on other machines. Can't try out the installation on the network PCs as I don't have administrative privileges.

The installed .NET framework versions are the same on all the machines I have tried to run it on.

It is frustrating ... this doesn't feel like something that should be this difficult!

Any help anyone can suggest would be most welcome.

Thanks,
David
 
no exceptions thrown
Are you absolutely sure about that? Are you handling the UnhandledException event of the application and logging anything it catches?

Does the application do anything before the main form is displayed that might account for this, e.g. attempt to connect to a database that may not exist?
 
First ... thanks to whoever moved this to the correct forum. New here, so still finding my way around.

I thought I had but will go back and check.

D
 
It appears to be set up to catch exceptions wherever they might happen, but I haven't got it logging. Need to look at that.

What is interesting to me is that the files are all stored in OneDrive, and I can go to the Release folder on any of the school PCs that I use and it works perfectly by clicking on the application icon in my synchronised OD folder. If I go to the exact same synchronised folder at home, it doesn't work at all (the application and .accdb file are both stored in that same folder and the application is definitely using that copy of the database). It also doesn't work by sharing the files with someone else.

I am clearly missing something, just not sure what I should be looking at.

D
 
Run Process Monitor from sysinternals.com and look at which files the program tries to open in which locations. That usually gives you a clue to what is missing or wrong.
 
I have tried to run the program elsewhere by simply copying the files from the Release folder, and that works on [any PC attached to the same network as the machine I wrote it one
Or perhaps there is a network resource that you are trying to access that is not accessible from the other machines?
 
Back
Top Bottom