简体   繁体   English

我是否可以将Visual Studio 2010配置为仅在我的源代码中显示警告?

[英]Can I configure Visual Studio 2010 to show warnings only in my source code?

I like having a high level of warnings (usually W4). 我喜欢高水平的警告(通常是W4)。 However, with a warning level of 4 or higher, I get a lot of warnings from Windows headers and from third party headers, which makes it very difficult to find the ones I can actually do something about. 但是,警告级别为4或更高时,我会收到来自Windows标头和第三方标头的大量警告,这使得我很难找到实际可以做的事情。

Hence my question: Can I tell Visual Studio to show warnings only for those files which belong to my current project? 因此我的问题是:我是否可以告诉Visual Studio仅针对属于我当前项目的那些文件显示警告?

This would be especially useful when running code analysis. 这在运行代码分析时尤其有用。 Why show all those warnings for code that I don't own? 为什么要显示我不拥有的代码的所有警告?

I found one thing that might help: 我找到了一件可能有用的东西:

Right click anywhere on one of the rows in the Error List and click Grouping->Path. 右键单击错误列表中其中一行的任意位置,然后单击“分组 - >路径”。 The path to the file will show up on the left. 该文件的路径将显示在左侧。 Now you can collapse all the paths to code that you want to ignore. 现在,您可以折叠要忽略的代码的所有路径。

It's not ideal, but it's better than nothing. 它并不理想,但总比没有好。

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

相关问题 如何在Visual Studio 2010中配置编译器警告? - How do I configure compiler warnings in Visual Studio 2010? 如何使用Visual Studio 2010 Express在.NET Framework源代码中设置断点? - How can I set a breakpoint in .NET Framework source code using Visual Studio 2010 Express? 我无法在我的Visual Studio 2010安装中显示TestDriven.NET - I can't get TestDriven.NET to show up in my installation of Visual Studio 2010 有没有办法在 Visual Studio 2010 中显示所有编译器警告? - Is there a way to show ALL the compiler warnings in Visual Studio 2010? 如何使用Visual Studio安装程序在Visual Studio 2010中配置安装程序以检查更新? - How Do I configure my setup in Visual Studio 2010 using Visual Studio installer to check for updates? Visual Studio 2010的源代码大纲窗口 - Source Code Outline Window for Visual Studio 2010 我无法使用Visual Studio 2010 Ultimate将源代码从本地驱动器推送到CodePlex - I'm having trouble pushing my source code from my local drive to CodePlex using Visual Studio 2010 Ultimate 安装Visual Studio 2010,我只能选择.NET 4作为我的目标框架 - Installed Visual Studio 2010 and I can only choose .NET 4 as my target framework 在Visual Studio 2010中是否在下划线警告? - Underline warnings in Visual Studio 2010? Visual Studio 2010中的代码分析警告-CA1007 - Code Analysis Warnings in Visual Studio 2010 - CA1007
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM