After upgrading my WinForms VS2013 project to VS2015, I started seeing the MSB3884 \"Could not find rule set file\" warning.
A Google search turned up one MSDN article,
I've just had the same problem after upgrading from VS2013 to VS2015.
My solution was:
Had this when compiling a solution upgraded from VS2015 to VS2017 but had MSBuild 14 in the path (C:\Program Files (x86)\MSBuild\14.0\Bin). Changed to ensure 15 was in the path (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin) and all worked.
You said your project files giving off the warnings did not contain any <CodeAnalysisRuleSetDirectories>
entry.
Mine did not either, and like you I get the file if I click the Open button in the project properties Code Analysis section.
However, searching all project files in the solution turned up two projects which did have <CodeAnalysisRuleSetDirectories>
tags, and those tags contained an older version of the Visual Studio reference in the path.
Fixing those paths fixed my problem, and I've just confirmed that the project which was raising the error references a project which referenced the projects which contained the bad <CodeAnalysisRuleSetDirectories>
entries.
So search the whole solution and fix all <CodeAnalysisRuleSetDirectories>
paths, or try removing them.
In my case
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
became
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
(Jon Shadforth's answer also worked for me, but I didn't like adding the path to more projects - as timB33 commented)
I got rid of this warning by setting <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
I had this error on my build server which has Visual Studio Build Tools on it rather than Visual Studio.
The solution for me was to use the installer to enable Static analysis tools
in the individual components list.
I spent some time looking at the different solutions proposed here - they each had good elements but each required some adjustments. I found a clean solution to be:
Locate an existing or create a <PropertyGroup>
element in the project file that has NO conditions (e.g configuration or platform) i.e that will apply to all configurations on all platforms. To this element add a <CodeAnalysisRuleSetDirectories>
element specifying the relative path to the "Rule Set" directory from the current dev env directory, e.g:
<PropertyGroup>
<CodeAnalysisRuleSetDirectories>$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\Rule Sets</CodeAnalysisRuleSetDirectories>
</PropertyGroup>