When building our solution on the build server (using Jenkins) with MSBuild 14 following warning occurs:
C:Program Files (x86)MSBuild14.0binMicrosoft.VisualBasic.CurrentVersion.targets(133,9): warning MSB3884: ruleset file "ManagedMinimumRules.ruleset" could not be found.
Executing the same command line call on my dev machine this warning won't appear.
I've installed the Build Tools 2015, .NET Targeting packs, .NET SDKs on the build server but nothing helped.
One of my project file looks like:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0DE22053-805A-49D9-802A-4CC4104719C8}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>CHG.iCLASSFW.Base.Foundation</RootNamespace>
<AssemblyName>CHG.iCLASSFW.Base.Foundation</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>..\bin\Client\</OutputPath>
<DocumentationFile>CHG.iCLASSFW.Base.Foundation.xml</DocumentationFile>
<NoWarn>42353,42354,42355</NoWarn>
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42105,42106,42107</WarningsAsErrors>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
<OptionCompare>Binary</OptionCompare>
<OptionStrict>On</OptionStrict>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>..\bin\Client\</OutputPath>
<DocumentationFile>CHG.iCLASSFW.Base.Foundation.xml</DocumentationFile>
<NoWarn>42353,42354,42355</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42105,42106,42107</WarningsAsErrors>
<Prefer32Bit>false</Prefer32Bit>
<DefineConstants>
</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\bin\Client\</OutputPath>
<Prefer32Bit>false</Prefer32Bit>
<DefineConstants>
</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<Prefer32Bit>false</Prefer32Bit>
<OutputPath>..\bin\Client\</OutputPath>
<DefineConstants>
</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Data" />
<Reference Include="System.DirectoryServices" />
<Reference Include="System.DirectoryServices.AccountManagement" />
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Xml" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\CHG.iCLASSFW.AssemblyInfo.vb">
<Link>CHG.iCLASSFW.AssemblyInfo.vb</Link>
</Compile>
<Compile Include="Attributes\HexColorAttribute.vb" />
<Compile Include="Attributes\iCLASSFWPackageAttribute.vb" />
<Compile Include="Attributes\PerformanceCriticalAttribute.vb" />
<Compile Include="Attributes\SecurityRelevantAttribute.vb" />
<Compile Include="classes\ActiveDirectoryCrawler.vb" />
<Compile Include="classes\ApplicationInfo.vb" />
<Compile Include="classes\AssemblyInfo.vb" />
<Compile Include="classes\BaseMarshallingObject.vb" />
<Compile Include="classes\CertificateCallback.vb" />
<Compile Include="classes\CHGActionResult.vb" />
<Compile Include="classes\CHGExceptionMessage.vb" />
<Compile Include="classes\CHGMessage.vb" />
<Compile Include="classes\CHGMessageList.vb" />
<Compile Include="classes\CHGResult.vb" />
<Compile Include="classes\ClassMockBuilder.vb" />
<Compile Include="classes\DataColumnInfo.vb" />
<Compile Include="classes\DisplayMessage.vb" />
<Compile Include="classes\DynamicPropertyDescriptor.vb" />
<Compile Include="classes\EnforceUsingBlockAttribute.vb" />
<Compile Include="classes\EnumSortOrderAttribute.vb" />
<Compile Include="classes\EqualityComparer.vb" />
<Compile Include="classes\ConfigFileHelper.vb" />
<Compile Include="classes\configuration\AppSettingsHelper.vb" />
<Compile Include="classes\configuration\AssemblyBuildDateAttribute.vb" />
<Compile Include="classes\configuration\CustomAttributeHelper.vb" />
<Compile Include="classes\configuration\DefaultConfigSection.vb" />
<Compile Include="classes\configuration\SerializingConfigSection.vb" />
<Compile Include="classes\configuration\XMLConfigSection.vb" />
<Compile Include="classes\CoreAppEnv.vb" />
<Compile Include="classes\CustomParameter.vb" />
<Compile Include="classes\DisposableObject.vb" />
<Compile Include="classes\DynamicProxy.vb" />
<Compile Include="classes\EnumDescriptionKeyAttribute.vb" />
<Compile Include="classes\EnumStringAttribute.vb" />
<Compile Include="classes\EnumTextKeyAttribute.vb" />
<Compile Include="classes\ExternalMessage.vb" />
<Compile Include="classes\Health\InternalCPUStatus.vb" />
<Compile Include="classes\Health\InternalMemoryStatus.vb" />
<Compile Include="classes\Health\NativeMethods.vb" />
<Compile Include="classes\iCLASSBackgroundWorker.vb">
<SubType>Component</SubType>
</Compile>
<Compile Include="classes\IgnoreOnSaveAttribute.vb" />
<Compile Include="classes\InstantDebugStopwatch.vb" />
<Compile Include="classes\ListHelper.vb" />
<Compile Include="classes\NotVisibleAttribute.vb" />
<Compile Include="classes\PrimaryKey.vb" />
<Compile Include="classes\PropertyComparer.vb" />
<Compile Include="classes\Range.vb" />
<Compile Include="classes\SettingsBase.vb" />
<Compile Include="classes\ThreadSafeDictionary.vb" />
<Compile Include="classes\ValuePair.vb" />
<Compile Include="classes\ValuePairList.vb" />
<Compile Include="classes\ValueTripple.vb" />
<Compile Include="classes\ValueTrippleList.vb" />
<Compile Include="CLI\InvalidValueException.vb" />
<Compile Include="CLI\OptionItem.vb" />
<Compile Include="CLI\OptionNameAttribute.vb" />
<Compile Include="CLI\Options.vb" />
<Compile Include="CLI\Parser.vb" />
<Compile Include="CLI\ShortOptionNameAttribute.vb" />
<Compile Include="EnumImageKeyAttribute.vb" />
<Compile Include="enums\iCLASSFWModule.vb" />
<Compile Include="enums\iCLASSFWModuleGroup.vb" />
<Compile Include="enums\MessageType.vb" />
<Compile Include="enums\GeneralYesNo.vb" />
<Compile Include="enums\iCLASSDialogButtons.vb" />
<Compile Include="enums\iCLASSDialogResult.vb" />
<Compile Include="enums\SqlDateFormatStyle.vb" />
<Compile Include="enums\SqlServerTypeId.vb" />
<Compile Include="interfaces\IBackgroundWorker.vb" />
<Compile Include="classes\IconManager.vb" />
<Compile Include="classes\MailSettings.vb" />
<Compile Include="classes\Singleton.vb" />
<Compile Include="enums\SQLDataType.vb" />
<Compile Include="enums\TrimType.vb" />
<Compile Include="interfaces\ICHGResult.vb" />
<Compile Include="interfaces\IGenericResponse.vb" />
<Compile Include="interfaces\IMessageContainer.vb" />
<Compile Include="interfaces\IProvideObjectInstanceIdentifer.vb" />
<Compile Include="interfaces\ISupportAdditionalInformation.vb" />
<Compile Include="interfaces\ISupportUpdate.vb" />
<Compile Include="interfaces\ITextTranslator.vb" />
<Compile Include="interfaces\IValuePair.vb" />
<Compile Include="modules\CoreObjectTools.vb" />
<Compile Include="modules\CryptTools.vb" />
<Compile Include="modules\DataTableTools.vb" />
<Compile Include="modules\DateTools.vb" />
<Compile Include="modules\EnumTools.vb" />
<Compile Include="modules\ExceptionTools.vb" />
<Compile Include="modules\FileTools.vb" />
<Compile Include="modules\FormatTools.vb" />
<Compile Include="modules\IdeTools.vb" />
<Compile Include="modules\ListTools.vb" />
<Compile Include="modules\NetTools.vb" />
<Compile Include="modules\NumericTools.vb" />
<Compile Include="modules\ObjectTools.vb" />
<Compile Include="modules\StringTools.vb" />
<Compile Include="modules\ThreadTools.vb" />
<Compile Include="modules\TypeTools.vb" />
<Compile Include="modules\ValidationTools.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="ObjectInstanceIdentifier.vb" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Compile Include="classes\ColorManager.vb" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
The cmd line call is:
"C:Program Files (x86)MSBuild14.0binMSBuild.exe" /consoleloggerparameters:NoSummary,NoItemAndPropertyList /verbosity:minimal /p:BuildType=Continuous /p:Configuration=Release "/p:Platform=Any CPU" BuildDependenciesSmallBuildFile.build "
The build file just executes the MSBuild target.
<!-- Start compiling -->
<Target Name="Compile">
<Message Text="Restore NuGet packages" />
<Exec Command="..\BuildDependencies\Tools\NuGet.exe restore ../CHG.iCLASSFW.sln -ConfigFile ..\nuget.config -Verbosity detailed" />
<Message Text="Compile Projects" />
<!-- First call clean, and then all targets. This is necessary to
execute targets like afterbuild in those projects, that have them. -->
<MSBuild Projects="../CHG.iCLASSFW.sln" Properties="Configuration=$(Configuration)" />
</Target>
How can I get rid of this warning?
I've added some debug messages to my .VBPROJ file, outputting some properties
<Message Text="CodeAnalysisRuleSet: $(CodeAnalysisRuleSet)" Importance="High"/>
<Message Text="CodeAnalysisRuleSetDirectories: $(CodeAnalysisRuleSetDirectories)" Importance="High"/>
<Message Text="ResolvedCodeAnalysisRuleSet: $(ResolvedCodeAnalysisRuleSet)" Importance="High"/>
Results from build server:
CodeAnalysisRuleSet: ManagedMinimumRules.ruleset
CodeAnalysisRuleSetDirectories:
ResolvedCodeAnalysisRuleSet:
results from dev machine:
CodeAnalysisRuleSet: MinimumRecommendedRules.ruleset
CodeAnalysisRuleSetDirectories: ;C:\Program Files (x86)\Microsoft Visual Stud
io 14.0\Team Tools\Static Analysis Tools\\Rule Sets
ResolvedCodeAnalysisRuleSet: C:\Program Files (x86)\Microsoft Visual Studio 1
4.0\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.rules
et
It looks like the code analysis ruleset is installed by Visual Studio (or at least, one of its sub-packages other than the ones you've installed on the server so far). I am surprised that the ruleset is separate from the .targets file that references it, though. It's set in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.targets, then referenced in Microsoft.VisualBasic.CurrentVersion.targets that actually throws the error.
Does C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\MinimumRecommendedRules.ruleset exist on the server?
It looks like the warning is thrown in a task defined as:
<Target Name="ResolveCodeAnalysisRuleSet" Condition="'$(CodeAnalysisRuleSet)' != ''">
so you could avoid the warning by ensuring that CodeAnalysisRuleSet gets overridden to an empty string after all imports (probably only in your CI configuration). But that's working around the problem; it'd be nice to fix it for everyone. If that file is really missing on your machine, I can try to figure out who to bug internally about reconciling the Code Analysis targets and ruleset installation.
The file C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\MinimumRecommendedRules.ruleset exists on the build server, but only because I already copied it. On a clean machine with only Build Tools 2015 and .NET Targeting pack 4.5.1 installed this file and folder does not exists.
I can confirm that setting the CodeAnalysisRuleSet to empty solves my problem.
<Target Name="BeforeBuild">
<PropertyGroup>
<CodeAnalysisRuleSet></CodeAnalysisRuleSet>
</PropertyGroup>
</Target>
But this is just a workaround. I definitely won't apply this approach to all my 100 projects of the solution. There have to be a better solution.
Any updates on this issue?
I'm trying to find someone on the FxCop side to help figure out where we should detect that it's not installed and avoid running it.
To set expectations, this seems likely to not be fixed in a shipping product until a future version of VS. Depending on the exact nature of the changes, they seem likely to be a bit risky to implement in VS2015 Update 2.
Let me summarize what I understood from all the comments:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\MinimumRecommendedRules.ruleset on the build machine.May I know why you are manually copying that ruleset onto the machine? It is only supposed to be installed with Visual Studio and FXCop toolset, so you have an unsupported environment. If you really must copy this ruleset, please make sure to copy over all the rulesets in the below screenshot (which come with VS and are inter-dependent on each other)

1) correct
2) wrong. Warnings appear on a clean machine with Build tools installed also.
3) I only copied the whole Program Files (x86)Microsoft Visual Studio 14.0Team ToolsStatic Analysis ToolsRule Sets folder to try out if the warnings disappear.
Thanks for the clarification - let me investigate 2 then.
Toni, I have filed an internal bug to track this issue - we hope to fix this for the next VS update/release.
Meanwhile, you can workaround this issue by either copying all of the above rulesets on your build server OR just edit the Microsoft.CodeAnalysis.Targets on the build server to set CodeAnalysisRuleset to empty. Hope that helps.
I already tried out copying all mentioned rulesets to the build server. Does not help.
Set the CodeAnalysisRuleset property to empty in the Microsoft.CodeAnalysis.Targets file. This is working.
If you don't want to edit your Microsoft.CodeAnalysis.Targets file, please note that it is not enough to merely copy the folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\ to the build server.
You _also_ need to create the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\EDev and add the string value StanDir = C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\
Or simply import this reg file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\EDev]
"StanDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Team Tools\\Static Analysis Tools\\"
This worked for us.
Suddenly this error do not appear anymore. ;(
So I'll close this issue until it appears again.
This is definitely still happening on a clean installation of MSBuild tools on a new build server (C# projects).
I recently installed a fresh Jenkins instance, installed MSBuild Tools 2015, all .NET Targeting packs (versions 4.0, 4.0.3, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1) and Windows 10 SDK with .NET 4.6 SDK.
Got warning MSB3884 for some projects, but not all.
The entire C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0 folder was missing (including the CodeAnalysis folder), as well as the C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools folder (including the Static Analysis Tools\Rule Sets folder)
Copied the CodeAnalysis and Rule Sets folders from my dev machine, then got warning MSB3884 for every project.
Imported the reg file as per my previous post, and it all works perfectly.
I just installed MSBuild Tools 2015, the 4.6.1 Developer pack (targeting pack and SDK), copied the rule sets folder and still get the MSB3884 warning.
Ran the registry file, and MSB3884 is no longer being thrown.
I haven't tried this one but seems legit.
http://stackoverflow.com/a/35156527/1634225
/cc @natidea - This is internal bug 170085 that is assigned to Nat.
Similar to @nexaddo - I installed MSBuild Tools 2015, 4.6.1 Developer pack, copied the rulesets folder AND ran the registry file.. but, unfortunately, my MSB3884 warnings _still_ show. ;(
FWIW - I'm on Jenkins 2.22
EDIT
After solving some other issues with my build - _which I thought were unrelated to this issue_ - these warnings are now indeed magically gone. Sorry for the confusion.
@bkwdesign What other issues did you solve? I am also running into this issue and other build issues with a clean install of MSBuild.
Why is it so hard for Microsoft to create a single compiler and build tool and use that both from command line and in VS.
Currently different things happen in VS versus what MSBuild does. This is extremely annoying.
I just want to build our project from the command line on the build server.
It would be way too much overkill to buy a new VS licence and install VS completely just for a build server.
_Refer to this excerpt from my answer on S.O. - HTH:_
When I first received my clean "Windows 2012 R2" server, it simply had a lot of things missing.. and I'm wondering if I had installed Visual Studio first, if it would have rectified some of these things straight off?
Below is my synopsis of what I had to do - but it doesn't show the pain and suffering involved figuring it all out and the false starts. Maybe it'll help someone else, though.
First, _uninstalled_ 4.6.1 framework (because the next step, Win 7 SDK, needs a 'real' 4.0 framework)
-- (find Update for Microsoft Windows (KB3102467) and click Uninstall.)
-- also uninstalled anything from MS labeled with C++ redistributable (a later step will restore these)Then, install Windows 7 SDK (installs critical "reference assemblies" and a proper baseline 4.0 framework)
-- Then, install Multi-Targeting Pack for Framework 4.0.1 (netfx_401mtpack.exe)
-- Then, install Multi-Targeting Pack for Framework 4.0.3 (netfx_403mtpack.exe)Then, reinstalled 4.6.1 framework for 2012 R2 (KB3102467)
Then, installed Microsoft .NET Framework 4.6.1 Developer Pack (DP461-DevPack-KB3105179-ENU.exe)
Then, installed "Visual Studio 2015 Build Tools" (BuildTools_Full.exe)
Downloaded a copy of nuget.exe and put it in the C:Windows directory
This stackoverflow answer gives my best detailed account of what I had to
do to get our Jenkins CI server off the ground.
http://stackoverflow.com/a/39625029/1520850
On Wed, Oct 19, 2016 at 8:51 AM Willem Burgers [email protected]
wrote:
@bkwdesign https://github.com/bkwdesign What other issues did you
solve? I am also running into this issue and other build issues with a
clean install of MSBuild.Why is it so hard for Microsoft to create a single compiler and build tool
and use that both from command line and in VS.
Currently different things happen in VS versus what MSBuild does. This is
extremely annoying.
I just want to build our project from the command line on the build server.
It would be way too much overkill to buy a new VS licence and install VS
completely just for a build server.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/msbuild/issues/361#issuecomment-254802782,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADB8KVHnMH0YK8V4d7wLydANYbqF92tBks5q1hI2gaJpZM4Gla_q
.
@bkwdesign
Thank you very much for your answer.
I cleaned many of the installations and started over installing all the .net frameworks and SDKs in the proper order.
I am still having problems, but that has to do with the latest dotnet core tooling I think.
I don't currently have solutions that use NET core, so, I didn't have to
account for that in my CI setup
On Thu, Oct 27, 2016 at 4:13 AM, Willem Burgers [email protected]
wrote:
@bkwdesign https://github.com/bkwdesign
Thank you very much for your answer.
I cleaned many of the installations and started over installing all the
.net frameworks and SDKs in the proper order.
I am still having problems, but that has to do with the latest dotnet core
tooling I think.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/msbuild/issues/361#issuecomment-256576466,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADB8KV5dg1_xL863s89LFK334ZVKNwDlks5q4F0hgaJpZM4Gla_q
.
_code.bkwdesign.com http://code.bkwdesign.com/_
_Home: 440 427 8795_
_Cell: 440 382 9869_
I had the same problem. Only after manually creating the C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets folder and copying over all of my .ruleset files, and creating the registry key did it go away.
Is there also a documented workaround for this issue for MSBuild 15 "Build Tools for Visual Studio 2017"? I tried the above, to no avail.
The worst part of this is that when you add new solution/project build configurations, VS2017 shoves the <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> into the new PropertyGroups, even if it wasn't present in any of the existing property groups.
@mavasani is there any progress in the internal bug report?
@StingyJack that problem is tracked at https://github.com/dotnet/roslyn/issues/24266
Most helpful comment
If you don't want to edit your Microsoft.CodeAnalysis.Targets file, please note that it is not enough to merely copy the folder
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\to the build server.You _also_ need to create the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\EDevand add the string valueStanDir=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Or simply import this reg file:
This worked for us.