Could not start code analysis from command line using msbuild

I am using VS2010 RC when configuring .NET 3.5. I can run code analysis through Visual Studio without any problems. However, when I try to analyze the code on our CI server, it fails. When I try to build using msbuild 4.0, I get the following exception:

C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v10.0 \ CodeAnalysis \ Microsoft.CodeAnalysis.targets (129.9): error MSB4018: task "CodeAnalysis" unexpectedly ended.

C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v10.0 \ CodeAnalysis \ Microsoft.CodeAnalysis.targets (129.9): error MSB4018: System.TypeLoadException: Failed to load type 'System.Runtime.Versioning. TargetFrameworkAttribute 'from assembly' mscorlib, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089

As I said, it works great when I run it through VS.

+3
source share
1 answer

You will have a hard time setting it up ...

I would install VS2010 on the build server. The problem is resolved.

Note:
The build server must be a replication of the development environment (and not the production environment).

0

Source: https://habr.com/ru/post/1738352/


All Articles