2013-06-27 214 views
15

我想讓TeamCity構建一個我創建的簡單Web項目。該項目是使用Visual Studio 2012模板創建的網站。我還沒有添加任何內容。TeamCity編譯項目編譯錯誤

該項目將建立和運行在本地機器上很好,當我使用Visual Studio(SLN)亞軍也不會建立。

我不斷收到以下錯誤...(道歉長剪切和粘貼)

[MSBuild output] C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "AspNet.ScriptManager.jQuery.UI.Combined". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.Core". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.OAuth". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.OAuth.Consumer". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.OpenId". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.OpenId.RelyingParty". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.AspNet". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.AspNet.Membership.OpenAuth, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.AspNet.FriendlyUrls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] 

[14:22:40][MSBuild output] 

[14:22:40][MSBuild output] "C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest.sln.teamcity" (TeamCity_Generated_Build target) (1) -> 

[14:22:40][MSBuild output] "C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest.sln" (Rebuild target) (2) -> 

[14:22:40][MSBuild output] "C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj" (Rebuild target) (3) -> 

[14:22:40][MSBuild output] (CoreCompile target) -> 

[14:22:40][MSBuild output] App_Start\AuthConfig.cs(5,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] Account\Manage.aspx.cs(7,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] Account\OpenAuthProviders.ascx.cs(4,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] Account\Register.aspx.cs(8,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] Account\RegisterExternalLogin.aspx.cs(4,7): error CS0246: The type or namespace name 'DotNetOpenAuth' could not be found (are you missing a using directive or an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] Account\RegisterExternalLogin.aspx.cs(5,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] App_Start\RouteConfig.cs(5,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] ViewSwitcher.ascx.cs(8,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj] 

[14:22:40][MSBuild output] 

[14:22:40][MSBuild output]  11 Warning(s) 

[14:22:40][MSBuild output]  8 Error(s) 

[14:22:40][MSBuild output] 

[14:22:40][MSBuild output] Time Elapsed 00:00:00.56 

這些引用似乎都是參考文獻的NuGet,我錯過了一步這裏的TeamCity?我應該使用不同的亞軍?

回答

15

TeamCity正在尋找它們的組件可能不存在。當解決方案/依賴關係移動時,我已經看到了這一點。

你可以嘗試開放的文本編輯器中的.csproj文件和審查<HintPath>值有問題的組件。這些通常是相對路徑,因此您需要確保它們與CI服務器上的目錄結構對齊。理想情況下,目錄結構將在兩種環境中匹配。

例子:

<ItemGroup> 
    <Reference Include="ServiceStack"> 
     <HintPath>..\packages\ServiceStack.3.9.56\lib\net35\ServiceStack.dll</HintPath> 
    </Reference> 
    ... 
</ItemGroup> 

您可能還需要檢查前的未來建設中的「前建造潔淨的檢出目錄中的所有文件」只是要確定它拿起變化。

+1

三江源這麼多。上帝保佑互聯網。 – Ronnie

2

我認爲你只是缺少在構建你的NuGet包,因爲它可能會成爲一個新的位置。那是除非你讓他們簽入源代碼管理?你需要告訴teamcity來獲取它們。

有一個Teamcity Nuget安裝構建步驟,用於獲取軟件包Teamcity nuget installer docs,或者您可以推出自己的任務來執行此操作。

0

只是爲了記錄在案,這可能可能是由於您的方案,以建立依賴關係......

例如如果在結帳時該文件夾被「清理」,並且你的構建依賴關係是錯誤的,那麼DLL將不會在任何地方。

我經歷這個問題上未能通過TeamCity的應用修補程序之後,該項目未設置爲自身清潔結賬......當它沒有被清洗的構建依賴問題並不明顯。

的文件夾,導致因錯誤被清理...等構建依賴問題來到了前臺。

4

我最近有這個。

對我來說有兩件事幫助解決了這個問題。

1)I移動時均嵌套解文件夾的根級別的項目。 2)我檢查了TeamCity服務器上的工作文件夾,以查看SVN(在我的情況下)中檢出的內容以及正在下載/恢復哪些軟件包。我不得不刪除/添加被錯過的軟件包(對於其中的一個軟件包)(Microsoft.OWIN.Hosting),這根本沒有被下載/恢復(我認爲它不能在Nuget上找到軟件包),所以我有要刪除軟件包,請在我的項目中明確引用該DLL,並將DLL複製到同一位置的TC框。真的很可怕,但建立起來了。我敢肯定有更好的方法來做到這一點 - 也許在SVN外部材料。

希望這會有所幫助。