开发者

WPF application is not starting up when changing Active solution platform from Any CPU to x86

开发者 https://www.devze.com 2023-02-27 10:08 出处:网络
I am working on a WPF application. Which is running fine with \"Any CPU\" as Active solution platform, but when it is changed to \"x86\" application starts but stoping without showing up any form or e

I am working on a WPF application. Which is running fine with "Any CPU" as Active solution platform, but when it is changed to "x86" application starts but stoping without showing up any form or error message. Application neither throws any exception nor logging any error in event log.

I am running this application on .NET 4.0 framework and Windows 7 64 bit OS.

appreciate y开发者_Go百科our help to solve this issue.

Thanks, maxk


First off, it's strange that you don't get any error messages. Not even when you launch the built application without debugger?

The best answer anyone can give based on the information provided, is to do some trial and error debugging:
1) Create a new empty project, set it to x86, see if it runs. If not, there is some serious problems with your machine setup, you'll probably have to reinstall.
2) In your own project, if you have any external references start removing them one by one and see if your app starts to run. Maybe a referenced dll is causing havoc in 32-bit mode.
3) Start commenting out blocks of code to see if your app starts to run then. I've found out that having errors in Window_Loaded methods (especially while debugging) can cause problems - exceptions not being handled, application crashing etc.
4) Could be that you have a bad Visual Studio plugin (I assume you are using VS and problems are occuring on your development machine). Try running the app without debugging...
5) Create a virtual machine and try your app in there, if it works there, then your machine is somehow "corrupted"..

PS! Just for your information, because you are running a 64-bit OS, then the Any CPU setting causes your app to be 64-bit. Forcing it to be 32-bit can cause problems if you are using badly written native dlls (although it's usually the other way round - problems occuring when going to 64-bit from 32-bit).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号