简体   繁体   English

如何在VS 2010中的第一个错误上停止C#编译(VS 2008宏不起作用)!

[英]How to stop C# compile on first error in VS 2010 (VS 2008 macros don't work)!

New information : 新信息
This question has been re-asked here and has been correctly answered by Noah Richards with a solution that works in VS 2010. 这个问题在这里重新提出,并且Noah Richards已经正确地回答了这个问题,该解决方案适用于VS 2010。

At work we have a C# solution with over 80 projects. 在工作中,我们有一个包含80多个项目的C#解决方案。 Is it possible in VS 2010 to automatically stop compilation as soon as an error is encountered rather than the default behaviour which is to continue as far as possible and display a list of errors in the error window? 是否有可能在VS 2010中遇到错误时自动停止编译而不是尽可能继续的默认行为并在错误窗口中显示错误列表?

I'm happy for it to stop either as soon as an error is encountered (file-level) or as soon as a project fails to build (project-level). 一旦遇到错误(文件级)或项目无法构建(项目级别),我很高兴它能够立即停止。

I'd also note that in VS 2008 we used macros similar to some of the answers below but they don't work in VS 2010 (at least I couldn't get them to as the environment events don't seem to fire in VS 2010). 我还注意到在VS 2008中我们使用的宏类似于下面的一些答案,但是它们在VS 2010中不起作用(至少我无法将它们用到,因为环境事件似乎没有在VS中触发2010)。

Also Somewhat Related: 也有点相关:
How to automatically stop Visual C++ build at first compile error? 如何在第一次编译错误时自动停止Visual C ++构建?

This question got closed as a duplicate so I re-asked it and it has been correctly answered by Noah Richards. 这个问题因为重复而被关闭,所以我重新问了一下,诺亚理查兹已正确回答了这个问题。

See this question VS2010 - How to automatically stop compile on first compile error for a solution that works in VS 2010. 请参阅此问题VS2010 - 如何在VS 2010中使用的解决方案的第一次编译错误时自动停止编译

Ctrl + Break应该可以解决问题。

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

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