Reputation: 250
I have developed a wpf application on my windows xp machine with VS 2010 targeting .net framework 3.5 sp1 and using wpf toolkit. i have used sqllite as database of the application. when i deploy that application on windows xp sp2 or sp3 it runs fine. but when i deploy this application on windows 7 home premium x64 or windows 7 ultimate x84 and when i click on the button which opens a popup window the application crashes. but when i set the compatibility mode to windows xp sp3 for that application. the application runs fine in windows 7. i'm quite confused about the issue.please let me know if you find the issue and the solution?
Upvotes: 3
Views: 1832
Reputation: 250
I think i have found out the Solution. when i have tried to install the application into any other location other than the program files the application it works fine. May be the problem is i have placed my sqllite db file into the installation folder which is by default c:\program files and in win 7 the write permission is denied. so when i'm trying to insert any records in to the database it shows an error.
Upvotes: 1
Reputation: 12794
Most likely, you are using paths that are restricted in Windows 7. Do you write data or store databases in any of the following paths? These paths require administrator access to write to.
Folders
C:\Documents and Settings\All Users
C:\Program Files
C:\ProgramDataRegistry Hives
HKEY_CLASSES_ROOT
HKEY_LOCAL_MACHINE
Realise that your application is likely installed in Program Files, so any settings files or databases installed in the same folder will be read only.
The solution is to either relocate the dynamic files to somewhere like %AppData%
or %LocalAppData%
, or to modify the permissions on the required files or folder to allow all users read/write access.
Upvotes: 0
Reputation: 69260
The best way is if you can 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 the AppDomain.UnhandledException
. In the event handler add a simple call to messagebox that shows as much of the exception as possible, including the stack trace. That should show you the error that causes the program to crash.
Upvotes: 2