简体   繁体   English

在Team City Build服务器上编译ASP.NET MVC2

[英]Compile ASP.NET MVC2 on Team City Build server

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. 我有一个旧的MVC2项目,我正在尝试从一个旧的巡航控制CI服务器迁移到我们当前的TeamCity CI服务器。

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?) Models \\ State \\ ControllerStates.cs(3,18):错误CS0234:名称空间“ System.Web”中不存在类型或名称空间名称“ Mvc”(您是否缺少程序集引用?)

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. [14:57:16] ResolveAssemblyReference [14:57:16] C:\\ Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319 \\ Microsoft.Common.targets(1360,9):警告MSB3257:主要参考“系统。无法解析“ Runtime.Serialization”,因为它的版本“ 4.0.0.0”比当前目标框架中的版本更高。 The version found in the current target framework is "3.0.0.0". 当前目标框架中的版本为“ 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. TeamCity构建步骤正在使用Visual Studio(.sln)运行器vs2012。这是Team city记录的csc命令的一部分。

/reference:C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\System.Configuration.dll et al. /reference:C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\System.Configuration.dll等。

I found a VS2012 installation it works correctly, and the similar parameter looks like this: 我发现VS2012安装可以正常工作,类似的参数如下所示:

/reference:C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\System.Configuration.dll et. /reference:C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\System.Configuration.dll等。 al.

So it's using the wrong version of some assemblies, and I'm not sure why. 因此,它使用了某些程序集的错误版本,但我不确定为什么。

I have no idea what was wrong, but I've set up a new build agent and that works correctly, so I don't think TC or my project are to blame, but rather something fishy with the setup on the build agent. 我不知道出了什么问题,但是我已经建立了一个新的构建代理并且可以正常工作,所以我不认为应该归咎于TC或我的项目,而是构建代理上的设置有些混乱。

This is not a great answer, but if you have a similar problem you may want to cut to the chase and re-build or add a new build agent. 这不是一个很好的答案,但是如果您遇到类似的问题,则可能要追逐并重新构建或添加新的构建代理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM