I have an old MVC2 project, which I am trying to move from an old cruise control CI server to our current TeamCity CI Server.
I'm getting screeds of build errors of the form:
Models\State\ControllerStates.cs(3, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
I get a lot of warnings of the form:
[14:57:16]ResolveAssemblyReference [14:57:16]C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360, 9): warning MSB3257: The primary reference "System.Runtime.Serialization" could not be resolved because it has a higher version "4.0.0.0" than exists in the current target framework. The version found in the current target framework is "3.0.0.0".
The TeamCity build step is using the Visual Studio (.sln) runner vs2012 Here's part of the csc command logged by team city.
/reference:C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Configuration.dll
et al.
I found a VS2012 installation it works correctly, and the similar parameter looks like this:
/reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll
et. al.
So it's using the wrong version of some assemblies, and I'm not sure why.
MSBuild version
andMSBuild ToolsVersion
. What are they set to? My suspicion is that your ToolsVersion is set to 4.0 but should be 3.5 or 2.0. - Nanhydrin