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

↘锁芯ラ 提交于 2019-12-05 01:31:45

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

I was experiencing the above issue too, however none of the other solutions worked for me.

My Application logs in Event Viewer listed event ids 1018 and 1022. This appeared to be bizarrely related to an ASP.NET 2.0 dll (bizarre; as this was a blank WPF project only). The logs contained messages like this:

Windows cannot open the 64-bit extensible counter DLL ASP.NET_64_2.0.50727 in a 32-bit environment

In the end it turned out to be resolved when I disabled my anti-virus. I had read that this resolution worked for someone with McAfee; and it also worked for my environment, which has Avast.

I assume you tried on a machine that doesn't have visual studio installed, and also none of the components you are using for development.

You have only one option: start the application with a debugger on the machine that causes problems and check for exceptions there. (use WinDBG for example - it's light and easy).

This looks like a problem with missing dependencies, but might be something else also.

The Debugging Labs should give you enough information on how to use windbg to find your problem:

Also use this:

I had a very similar issue.

Check out this setting on your App Pool entry:

  • Go to Advanced Settings.
  • Change 'Enable 32-bit Applications' to 'TRUE'.

This worked for me!

(JaredPar) answer looks right (x64), but if not try right clicking on the EXE and running in admin mode for win 7.

I'm going to go with a wild guess that:

  • Either you have some odd corruption in your .NET Framework installation
  • There is some debug/release-specific code using #if DEBUG or the such that is substantially different to cause issues.
  • You have not compiled recently into Release yet (Try changing it to Release before compiling your latest code and make sure you get no errors).

Those are the only things I can think of off the top of my head.

I had run into a similar issue, I was missing a custom folder in the release mode I was referencing in the constructor. Adding the folder to the release fixed the problem.

Same problem .
Solved by adding missing dlls to the new folder path of the exe file.
In My case some nuget dlls of WindowsApiCodePack and a class dll which was in the solution .

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!