简体   繁体   中英

Microsoft Visual Studio C# 2010 Express: Can debug but not build

When I debug my C# program F5 , my program will run as intended; however, upon building it CTRL + F5 , my program immediately shuts down: "(Program) has stopped working". What are some possible explanations for this?

Don't try to guess at this and write the code to tell you. Add an event handler for AppDomain.Current.UnhandledException and display the value of e.ExceptionObject.ToString().

Ctrl+F5 is usually not the shortcut for building, but for starting the program without the debugger attached.

I would guess that your program is then started with a different working folder and crashes because you somewhere try to access a file relative to the working folder that is not found when you start with Ctrl+F5.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM