升级后的团队市构建失败到VS 2010 [英] Team City build fails after upgrade to VS 2010

查看:206
本文介绍了升级后的团队市构建失败到VS 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前编译愉快地对我使用VS 2010(psumably使用MSBUILD V4.0 $ P $)的开发计算机的一个项目,但它的团队城(基于2003赢在虚拟机上运行的下MSBUILD V3.5失败服务器W / .NET 2,3.5和4个装)。这个项目是新升级的2010年,现在没有在CI构建。我GOOGLE了这一点,想尽一切明显的(加了几件事,没有任何意义)并没有什么影响的结果。

I have a project that currently compiles happily on my dev machine using VS 2010 (presumably using MSBUILD v4.0), but it fails under MSBUILD v3.5 in Team City (running on a VM based on Win 2003 server w/ .NET 2, 3.5 and 4 installed). This project is newly upgraded to 2010, and is now failing on the CI build. I've Googled this and tried everything obvious (plus a few things that didn't make sense) and nothing affects the outcome.

该项目失败,一系列的错误是这样的:

The project fails with a sequence of errors like this:

error CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)

有解决方案中许多其他项目使用System.Core程序,将System.Data.Linq和System.Xml.Linq的,他们似乎都编译没有问题。有问题的项目是一个Web应用程序,它在它的配置/的System.Web /编译/组件部分如下设置:

There are numerous other projects in the solution that use System.Core, System.Data.Linq and System.Xml.Linq and they all seem to compile with no problems. The project in question is a web application, and it has the following settings in its configuration/system.web/compilation/assemblies section:

    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

加在同一个文件中的以下

Plus the following in the same file:

<system.codedom>
  <compilers>
    <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
      <providerOption name="CompilerVersion" value="v3.5"/>
      <providerOption name="WarnAsError" value="false"/>
    </compiler>
  </compilers>
</system.codedom>

在考虑中的项目,IIRC,既web应用,并得到后处理,PostSharp(V1.5)在我的解决方案的唯一项目。 PostSharp配置中的.csproj像这样:

The project in question is, IIRC, the only project in my solution that is both a WebApplication and is getting post-processed by PostSharp (v1.5). PostSharp is configured in the .csproj like so:

<PropertyGroup>
  <DontImportPostSharp>True</DontImportPostSharp>
  <PostSharpUseCommandLine>True</PostSharpUseCommandLine>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(POSTSHARP15)\PostSharp-1.5.targets" />

我不知道这到底是怎么扯上关系,但它的存在,以防万一。

I'm not sure how this could be related, but it's there just in case.

这是什么导致这个错误,或者对如何解决此问题的任何想法?

Any ideas on what's causing this error or on how to work around the issue?

TIA

推荐答案

解决:

添加引用web.config文件是没有意义的,因为PostSharp进入图片前ASP.NET已经完成了自己的任何编译,所以不存在的参考System.Core程序引用导致系统失败(我'不知道为什么)。

Adding the references to the web.config file is pointless, because PostSharp enters the picture before ASP.NET has performed any compilation of its own, so an absence of a reference to System.Core reference causes the system to fail (I'm not sure why).

解决方法是手动编辑的csproj文件失败的项目,并手动添加引用System.Core程序到项目中。从Solution Explorer,因为它不允许并称的引用你不能做到这一点应该的自动被添加MSBUILD

The solution is to manually edit the csproj file for the failing project and manually add a reference to System.Core to the project. You cannot do this from the solution explorer because it disallows adding references that should be added automatically by MSBUILD.

不过不知道为什么它失败摆在首位,但至少现在编译并再次通过测试。

Still not sure why it failed in the first place, but at least it now compiles and passes tests again.

这篇关于升级后的团队市构建失败到VS 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆