The app works fine on Windows XP, but when apps crash on Windows 7?

I had a wpf application developed on my Windows XP machine, targeting .NET .NET Framework 3.5 sp1 and using the wpf toolkit. I used sqllite as my application database. when i deploy this application on windows xp sp2 or sp3 it works fine. but when i deploy this app to windows 7 home premium x64 or windows 7 ultimate x84 and when i click on the button that opens the popup the app crashes. but when i set compatibility mode for windows xp sp3 for this application. the app works fine on Windows 7. I'm pretty confused about the problem. Let me know if you find a problem and solution?


source to share

3 answers

The best way is to install the development environment on a Win7 machine and run the program inside the debugger.

If that's not an option, you can add an event handler to AppDomain.UnhandledException

. In your event handler, add a simple call to the messagebox that shows as many exceptions as possible, including a stack trace. This should show you the error that is causing the program to crash.



I think I have found a solution. when i tried to install the app to any location other than the program files, the app works fine. Perhaps the problem is that I put my sqlite db file in the install folder which is c: \ program files by default and in win 7 it is not writeable. so when I try to insert any records into the database, it shows an error.



You are most likely using paths that are limited in Windows 7. Do you write data or database storage in any of the following paths? These paths require administrator write access.

C: \ Documents and Settings \ All Users
C: \ Program Files
C: \ ProgramData p>

Registry Streets

Think that your application is likely to be installed in Program Files, so any settings or database files installed in the same folder will only be read.

The solution is to either move the dynamic files somewhere like %AppData%

or %LocalAppData%

, or change the permissions on the desired files or folder to allow all users read / write access.



All Articles