我有一個項目,當前使用VS 2010在開發機器上編譯(推測使用MSBUILD v4.0),但在Team City的MSBUILD v3.5下運行基於Win 2003服務器(安裝了.NET 2,3.5和4)的虛擬機。該項目新近升級到2010年,現在在CI構建上失敗。我已經谷歌搜索,並嘗試了一切顯而易見(加上一些沒有意義的事情),並沒有影響結果。升級到VS 2010後Team City構建失敗
該項目失敗,錯誤的是這樣一個順序:
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 /編譯/組件部分具有以下設置:
<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"/>
加在同一個文件中的以下內容:
<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的配置,像這樣:
<PropertyGroup>
<DontImportPostSharp>True</DontImportPostSharp>
<PostSharpUseCommandLine>True</PostSharpUseCommandLine>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(POSTSHARP15)\PostSharp-1.5.targets" />
我不知道這到底是怎麼扯上關係,但它的存在,以防萬一。
關於是什麼原因導致此錯誤或有關如何解決該問題的任何想法?
TIA
嗨邁克,實際上我選擇保持3.5的框架,並能夠構建我的toolset =「4.0」文件,就好像它們是toolset =「3.5」(該框架相應地自適應) – 2010-06-21 06:08:25