簡體   English   中英

團隊合作后的銳利問題

[英]Postsharp problems on teamcity

我們有一個項目追蹤的.net Framework 4.0,並且正在使用postharp。 在我的本地計算機上一切正常,但是在我們的teamcity服務器上,我們收到以下錯誤

00:44][MSBuild output] "C:\TeamCity\buildAgent\work\a26b6bf43590f451\Main\myproj.csproj" (default target) (4:2) ->
[16:00:44][MSBuild output] (PostSharp30 target) -> 
[16:00:44][MSBuild output]   unknown : error PS0219: The targeting pack for target platform ".NETFramework,Version=v4.0" is either not installed or not properly registered. Please install the appropriate targeting pack. [C:\TeamCity\buildAgent\work\a26b6bf43590f451\Main\myproj.csproj]
[16:00:44][MSBuild output] 
[16:00:44][MSBuild output]     2 Warning(s)
[16:00:44][MSBuild output]     1 Error(s)
[16:00:44][MSBuild output] 
[16:00:44][MSBuild output] Time Elapsed 00:00:30.78

您收到的錯誤表明.NET SDK向MSBuild注冊時存在一些問題。 PostSharp使用MSBuild調用來確定已安裝的框架並獲取有關這些框架的信息。 您可以通過查看C:\\ProgramData\\PostSharp\\InstalledFrameworks目錄以及該目錄中最新的XML文件來檢查PostSharp“看到的內容”。

要解決此問題,請在生成服務器上安裝Microsoft Build Tools 2013。 然后,在TeamCity中配置構建步驟時,請確保已選擇Microsoft Build Tools 2013和MSBuild 12.0。 .NET 4.5(Visual Studio 2012)中的MSBuild也可以使用。

這實際上不是PostSharp錯誤-您的生成代理可能只是沒有安裝正確版本的Visual Studio。 您可以安裝VS,也可以在構建代理上手動安裝適當的定向包 (該鏈接適用於VS2013。如果您使用的是其他版本的VS,請參見該頁面上的其他鏈接。)

在這種情況下,“目標包”也稱為“ .NET SDK”可能會有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM