Ran into this issue again, but the previous solution doesn't apply (removing Microsoft.Net.Compilers v3.8.0 via Nuget - this package doesn't exist in this solution)...
We have a VS2019 solution that we just replaced the old Microsoft FXCop Code Analyzers (3.3.x) with the newer Microsoft.CodeAnalysis.NetAnalyzers (5.0.3) via Nuget.
We are using the build agent on a TFS 2015 Update3 server. The server has VS2019 and Build Tools, all updated to latest. The same as on our development machines.
The solution built just fine with the old/deprecated analyzers, but now throws an error with the new analyzers. The error is:
[ProjectPath]\src\packages\Microsoft.CodeAnalysis.NetAnalyzers.5.0.3\build\Microsoft.CodeAnalysis.NetAnalyzers.props (1): The default XML namespace of the project must be the MSBuild XML namespace.
If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element.
If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.
I have verified all projects in the solution do, in fact, have the recommended namespace in the [project] element. In doing some experimentation and research, something appears to be overriding the normal TFS 2015 compiler version. I cannot figure out what it would be.
NOTE: I went back to FXCop Code Analyzers 2.9.12 and everything builds in TFS just fine. When I tried to use 3.3.x, I get the same build error again. Not sure what that means.
We would like to get off the old/deprecated analyzers. Any and all help is very much appreciated.
msbuild
that from visual studio 2019 was used ? – Levi Lu-MSFT