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

时间:2021-09-10 15:26:38

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:

我得到了表单构建错误的screeds:

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. The version found in the current target framework is "3.0.0.0".

[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“。在当前目标框架中找到的版本是“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这是团队城市记录的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 et al。

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. al.

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

So it's using the wrong version of some assemblies, and I'm not sure why.

所以它使用了一些程序集的错误版本,我不知道为什么。

1 个解决方案

#1


0  

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.

这不是一个很好的答案,但是如果你有类似的问题,你可能想切入追逐并重新构建或添加新的构建代理。

#1


0  

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.

这不是一个很好的答案,但是如果你有类似的问题,你可能想切入追逐并重新构建或添加新的构建代理。