WPF DotNET Application will run in debug mode, but .EXE will not run

user441603 picture user441603 · Nov 17, 2010 · Viewed 19k times · Source

I wrote a WPF application in C# using VS 2010. The application will run fine in debug mode using Visual Studio, but when I go to run the .EXE from the bin\release folder, nothing happens. I do not get any error messages from windows and there are no errors or warnings in VS. I have tried to build, rebuild and clean the solution (in every possible order) with no luck. My solution contains 2 projects, both of which use .NET 4.0 framework, and I have .NET 4.0 installed on my PC. I have tried on both XP and Win7 and still nothing.

I also just noticed that the output from Debug when I run the application in debug mode says: "Cannot find or open the PDB file" after each .Dll it loads.

I am compiling to the Release folder every time, but i did try changing it to the debug folder and clean/rebuild just to see if that would make a difference, and it didnt, so I changed it back, tried it again, and still nothing.

Any Ideas?

Answer

JaredPar picture JaredPar · Nov 17, 2010

Here are a couple of ideas that come to mind

  • If you are on a x64 machine, try changing the application from being AnyCPU to x86. This the mode that applications default to in debug mode and it's possible an issue running in x64 is causing a problem in release builds
  • Possible the Release binaries are out of date. Delete the binaries from the Release folder, rebuild and run the newly generated runs
  • Run the release build under the debugger in Visual Studio and see if it till crashes