问题描述
升级我的WinForms VS2013项目VS2015后,我开始看到MSB3884找不到规则集文件的警告。
After upgrading my WinForms VS2013 project to VS2015, I started seeing the MSB3884 "Could not find rule set file" warning.
一个谷歌搜索翻移一个MSDN文章,其中一个堆栈溢出文章指向以及众多其他网站
A Google search turned up one MSDN article, which a Stack Overflow article points to as well as numerous other sites.
类似的问题:的
MSDN:的
我有无论VS2013和安装VS2015。
I have both VS2013 and VS2015 installed.
项目文件给予警告(和那些不这样做),没有这些条目。
The project files giving the warnings (and those that do not), do not have these entries.
<CodeAnalysisRuleSetDirectories>
<CodeAnalysisRuleDirectories>
如果我删除的项目文件中的另外两个项目,然后问题消失,这是显而易见的,因为没有规则集文件
If I delete the other two entries from the project file, then the problem goes away, which is obvious, as there is no rule file set.
<CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>
我试图建立外部使用的MSBuild,但VS2015往往表现出的问题太多。
I am trying to build externally using msbuild, however VS2015 tends to show the problem too.
有趣的是,如果我点击在项目属性代码分析器区,我得到该文件的打开按钮。
Interestingly enough, if I click on the open button in the project properties Code Analyzer area, I do get the file.
指定一个不同的规则集没什么区别。这让我觉得,可能的话,有一个环境变量设置,而不是任何浮现在脑海中。代码分析仪是在项目文件的功能。我可以添加目录属性,但共识是采取了路径,则< CodeAnalysisRule *目录方式>
Specifying a different rule set makes no difference. That makes me think that possibly, there is an environment variable setting, not that any come to mind. Code Analyzers is a function of the project file. I can add a directory attribute, but the consensus is to take out paths, the <CodeAnalysisRule*Directories>
.
该GUI使用默认值:
下面是一个典型的。工程文件片段
Here is a typical project file fragment.
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<CodeAnalysisRuleSet>BasicCorrectnessRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
没有摆脱从项目文件中的代码分析线,虽然再次保存项目文件将只添加回去,我怎么能消除/修复警告?
Without getting rid of the Code Analysis lines from the project file, though saving a project file again would just add it back, how can I eliminate/fix the warning?
推荐答案
我刚刚有同样的问题从VS2013升级后。到VS2015
I've just had the same problem after upgrading from VS2013 to VS2015.
我的解决办法是:
- 在项目属性去代码分析部分。
- 选择的规则集列表中的浏览选项。
- 浏览到VS2015规则集文件夹。的 C:\Program文件(x86)\Microsoft的Visual Studio 14.0\Team Tools\Static分析Tools\Rule设置的
- 选择一个规则集。通过新的项目使用的默认值是: MinimumRecommendedRules.ruleset 的
- 重建。检查警告已经一去不复返了。
- On the project properties go to the Code Analysis section.
- Select the Browse option on the list of rule sets.
- Browse to the VS2015 rule sets folder. C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets
- Pick a rule set. The default used by new projects is: MinimumRecommendedRules.ruleset
- Rebuild. Check the warning has gone.
这篇关于VS2015:警告MSB3884:找不到规则集文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!