Installed on client, program dies at setting a couple variables


Well-known member
Dec 5, 2012
Programming Experience
This runs fine on my development machine but dies without complaining when I build then run on a client. The offending code is below. I get a messagebox saying "Setting Globals" then after a few more seconds the program quits.

I have tried just copying the exe from the release folder and using publish and installing it - same things happen. Any ideas?

       MsgBox("Setting Globals")
        dbPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
        dbPath = Path.Combine(dbPath, "PdmPOS")
        MsgBox("dbGlobals set")
I checked some more and it is the CommonapplicationData line that causes the program to crash. I will stick it in a try block and see if I get an error from it
I changed where I declared some variables and it got further. Then I rebuilt, cleaned and built again and it got ever further. I had to manually copy sqlite dlls to the same directory and it gets even further.

Now I am stuck with an error saying a program was using an incorrect way to create something (which I assume is the text file I load to create an sqlite database. I will try just copying the database to Progamdata and see if it can deal with that.
Totally stuck now. Got to the point where I click a button but it never actually enters the sub. Time to completely start this project over.