tags:

views:

263

answers:

3
+1  Q: 

Can't run WPF app

I have Visual Basic Express 2008 and .net framework 3.5 on xp sp2.

I create a new wpf application, when I try run the application I get the following error.

" 'Error while trying to run project: Unable to start program 'C:\Documents and Settings\Mike\My Documents\Visual Studio 2008\Projects\WPF\bin\Debug\HelloWorld.exe' Access Denied"

Any ideas?

**This problem only occurs with WPF application, winforms app runs just fine.

Thanks

A: 

Looks like some program has an exclusive lock on your executable. Try a tool like Unlocker or WhoLockMe (there are many others) to find out, which process locks the file. Kill the process and your application should start.

Best Regards

Oliver Hanappi
Tried it with Unlocker. Didn't work. No locks found.
Maybe try one of the most well-proven error resolving strategies: reboot ^^
Oliver Hanappi
I'm also getting this error-- have tried rebooting, resetting permissions on the project folder and starting in release mode. Some other WPF projects will run (F5) correctly from the IDE.
A: 

Are you running Visual Studio as an administrator on you pc? VS does not like it so much when it is not running as admin.

I dont know if this is still true with the express editions, but do you have to actually save the project before you can run the code? I have not used an express edition in a while but I remember something funky with how new project where created.

Tony
Yip. My user account is set as Computer Administrator.
A: 

Did you try loading the program from inside Visual Studio using F11 or Control-F11, or did you use Windows Explorer instead? Make sure you are doing it from inside Visual Studio maybe.

PRINCESS FLUFF
I'm trying to run it from within the IDE. F5
Same here: F5 and Ctrl+F5 do not work, but double-clicking the generated executable in Exporer does.