开发者

Suppress errors of files that are not set to be built from the "Error List" window

I have some cs files in my project that are not set to be built (Properties -> Build Action = None). They contain bits of code that don't compile as a whole and are there merely for reference. I don't care about any compilation errors in them, but they appear in the "Error List" window. The errors don't stop compilation, merely clutter the window. Is there some way to tell VS to ignore errors in that file? Or in all files not set to be built, at that ?

I'm using VS 2010

Thanks

To reproduce this:

  1. Create a new C# project.
  2. Add a new .CS file to the project. Type some garbage in between the class Class { and the closing }.
  3. Don't build the proj开发者_如何学JAVAect
  4. Note that the Error List window says something like "Invalid token '}' in class, struct, or interface member declaration".
  5. Set the Build Action for the .CS file to "None".
  6. Notice that the Error List still displays the error.


That doesn't make a heckofalot of sense, can't repro it. What version of VS? Are you sure these aren't IntelliSense errors? Another way to tackle it is right-clicking the file in the Explorer window, Exclude from Project. Then click the Show all Files icon (top of window) to make it visible again.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜