2013-06-27 47 views
15

Tôi đang cố gắng để TeamCity xây dựng một dự án web đơn giản mà tôi đã tạo. Dự án đã được tạo bằng cách sử dụng mẫu Visual Studio 2012 cho một trang web. Tôi chưa thêm bất cứ điều gì cho nó.TeamCity xây dựng lỗi biên dịch dự án

Dự án sẽ xây dựng và chạy tốt trên máy cục bộ, nó sẽ không được xây dựng khi tôi sử dụng trình quay phim Visual Studio (sln).

tôi tiếp tục nhận được các lỗi sau đây ... (xin lỗi cho việc cắt giảm dài và dán)

[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 

những tài liệu tham khảo dường như tất cả được NuGet Refs, tôi thiếu một bước đây trong TeamCity? Tôi có nên sử dụng Runner khác không?

Trả lời

15

Có khả năng các hội đồng không tồn tại nơi TeamCity đang tìm kiếm chúng. Tôi đã nhìn thấy điều này khi giải pháp/phụ thuộc đã được di chuyển xung quanh.

Bạn có thể thử mở tệp .csproj của mình trong trình chỉnh sửa văn bản và xem lại các giá trị <HintPath> cho các hội đồng được đề cập. Đây thường là các đường dẫn tương đối, do đó bạn sẽ muốn chắc chắn rằng chúng xếp hàng với cấu trúc thư mục trên máy chủ CI của bạn. Lý tưởng nhất, cấu trúc thư mục sẽ phù hợp trong cả hai môi trường.

Ví dụ:

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

Bạn cũng có thể muốn kiểm tra "làm sạch tất cả các file trong thư mục kiểm tra trước khi xây dựng" hộp trước khi xây dựng tiếp theo chỉ để đảm bảo nó nhặt những thay đổi.

+1

Thankyou rất nhiều. Chúa ban phước cho Internet. – Ronnie

2

Tôi nghĩ rằng bạn chỉ thiếu gói nuget trong bản dựng vì có thể nó sẽ ở một vị trí mới. Đó là trừ khi bạn có họ kiểm tra để kiểm soát nguồn? bạn cần phải nói với teamcity để có được chúng.

Có một bước xây dựng cài đặt Teamcity Nuget để nhận gói Teamcity nuget installer docs hoặc bạn có thể cuộn nhiệm vụ của riêng mình để thực hiện việc này.

0

Chỉ để lưu nội dung, điều này có thể là do phụ thuộc xây dựng trong giải pháp của bạn ...

ví dụ: nếu trên thanh toán thư mục được 'làm sạch' và phụ thuộc xây dựng của bạn là sai thì dll sẽ không được bất cứ nơi nào.

Tôi đã gặp phải sự cố này sau khi Thất bại áp dụng bản vá của TeamCity và dự án không được đặt để tự làm sạch khi thanh toán ... khi không được làm sạch vấn đề phụ thuộc xây dựng không rõ ràng.

Kết quả trong thư mục đang được làm sạch do lỗi ... và do đó, vấn đề phụ thuộc xây dựng đã đến nền trước.

4

Tôi đã có tính năng này gần đây.

Đối với tôi, hai điều đã giúp giải quyết vấn đề.

1) Tôi đã di chuyển các Dự án nằm trong thư mục Giải pháp lồng nhau đến cấp cơ sở. 2) Tôi đã kiểm tra thư mục làm việc trên máy chủ TeamCity để xem những gì đã được kiểm tra trong SVN (trong trường hợp của tôi) và cũng có những gói nào đang được tải xuống/khôi phục. Tôi đã phải loại bỏ/thêm các gói đã bị bỏ lỡ và cho một trong số họ (Microsoft.OWIN.Hosting) điều này đã không được tải xuống/phục hồi ở tất cả (Tôi không nghĩ rằng nó có thể tìm thấy gói trên Nuget) vì vậy tôi đã có để loại bỏ các gói, tham khảo DLL một cách rõ ràng trong dự án của tôi, và sao chép DLL vào hộp TC trong cùng một vị trí. Thực sự kinh khủng nhưng đã xây dựng nó.Tôi chắc chắn có một cách tốt hơn để làm điều này - có thể với Externals trong SVN.

Hy vọng điều này sẽ hữu ích.

Các vấn đề liên quan