简体   繁体   English

Microsoft Visual Studio C#2010 Express:可以调试但不能构建

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

When I debug my C# program F5 , my program will run as intended; 当我调试我的C#程序F5时 ,我的程序将按预期运行; however, upon building it CTRL + F5 , my program immediately shuts down: "(Program) has stopped working". 然而,在构建CTRL + F5时 ,我的程序立即关闭:“(程序)已停止工作”。 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(). 为AppDomain.Current.UnhandledException添加事件处理程序并显示e.ExceptionObject.ToString()的值。

Ctrl+F5 is usually not the shortcut for building, but for starting the program without the debugger attached. Ctrl + F5通常不是构建的快捷方式,而是用于在没有附加调试器的情况下启动程序。

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. 我猜你的程序然后启动了一个不同的工作文件夹并崩溃,因为你在某个地方试图访问相对于工作文件夹的文件,当你用Ctrl + F5开始时找不到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Visual Studio 2010 Express for C#中进行调试生成 - How do I build for debug in Visual Studio 2010 Express for C# WPF / PrismV4:无法在Microsoft Visual Studio C#2010 Express中加载 - WPF/PrismV4: Can't load in Microsoft Visual Studio C# 2010 Express Visual Studio 2010 Express C#限制 - Visual Studio 2010 Express C# limitations Microsoft Visual C#2010 Express无法构建我简单的单机游戏应用程序 - Microsoft visual C# 2010 express won't build my simple monogame app 调试和跟踪Write / WriteLine不输出到Visual Studio 2010 C#Express中的输出 - Debug and Trace Write/WriteLine not outputting to output in Visual Studio 2010 C# Express Visual Studio C#2010 Express Debug运行速度比发布速度快 - Visual Studio C# 2010 Express Debug running Faster than Release 如何在Visual C#2010 Express中切换调试和发布? - How to switch between debug and release in Visual C# 2010 Express? 可变着色帮助[Microsoft Visual C#2010 Express] - Variable Coloring Help [Microsoft Visual C# 2010 Express] 使用Microsoft Visual C#2010 Express加载DLL - Loading DLLs with Microsoft Visual C# 2010 Express 如何在 Microsoft Visual C# 2010 Express 中部署项目? - How to deploy a project in Microsoft Visual C# 2010 Express?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM