views:

346

answers:

1

I'm using VS2010 RC while targeting .NET 3.5. I can run code analysis via Visual Studio without a problem. However, when I try to run code analysis on our CI server it isn't getting executed. When I attempt 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: The "CodeAnalysis" task failed unexpectedly.

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

Like I said, it works fine when I run it through VS.

A: 

You will have tough times to set this up...

I would install VS2010 on the build server. Problem solved.

Note:
The Build server should be a replication of your developer environment (not production environment)

Peter Gfader
You are the first person I have ever heard say that Peter. Why do you think a build environment should replicate a dev server instead of a prod environment?
devlife
A build server is used to compile your source (text files) into executables, and then run tests against those. This is what a dev machine is doing as well.A production environment (server) is just running the final application without compiling, testing, code analysis, etc...What do you think?
Peter Gfader