VS2015 MSB3884 warning: Could not find rule set file

前端 未结 5 732
眼角桃花
眼角桃花 2020-12-14 06:08

When I imported an old solution in VS2015 I receive loads of warnings MSB3884 warning: Could not find rule set file .. when building the solution.

Q

相关标签:
5条回答
  • 2020-12-14 06:22

    Use the DevEnvDir instead of the hardcoded path to your old version of VS (probably 2010).

    <CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
    <CodeAnalysisRuleSetDirectories>;$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
    
    0 讨论(0)
  • 2020-12-14 06:33

    Received this warning on a build machine where only VS 2017 Build Tools was installed (VS 2017 not installed). Once I installed the Static analysis tools (Individual components -> Code tools -> Static analysis tools) the warnings went away.

    0 讨论(0)
  • 2020-12-14 06:35

    I solved to add following to app.config.

    <Target Name="BeforeBuild">
        <PropertyGroup>
          <CodeAnalysisRuleSet></CodeAnalysisRuleSet>
        </PropertyGroup>
    </Target>
    
    0 讨论(0)
  • 2020-12-14 06:37

    You need to edit the .csproj file and find the reference to the CodeAnalysisRuleSetDirectories. Change the version of the Visual Studio reference in the path to the one that is for VS2015 (a.k.a 14) and reload the project. (That worked for me.)

    Alternatively delete all references of

    <CodeAnalysisRuleSetDirectories>
    <CodeAnalysisIgnoreBuiltInRuleSets> 
    <CodeAnalysisRuleDirectories> 
    <CodeAnalysisIgnoreBuiltInRules>
    

    I found the solution here.

    0 讨论(0)
  • 2020-12-14 06:39

    These binary analyzers are now deprecated link

    New projects in VS don't have these lines anymore.

    In VS 2019, I solved the problem by editing the project files and removing all lines related to CodeAnalysis, in all PropertyGroups.

    sample:

    0 讨论(0)
提交回复
热议问题