简体   繁体   English

团队合作后的锐利问题

[英]Postsharp problems on teamcity

We have a project trageting .net framework 4.0 and we are using postsharp. 我们有一个项目追踪的.net Framework 4.0,并且正在使用postharp。 everything is working fine on my local machine but on our teamcity server we get the following error 在我的本地计算机上一切正常,但是在我们的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

The error you are getting suggests that there is some problem with registration of .NET SDK's to MSBuild. 您收到的错误表明.NET SDK向MSBuild注册时存在一些问题。 PostSharp uses MSBuild calls to determine installed frameworks and fetch information about these. PostSharp使用MSBuild调用来确定已安装的框架并获取有关这些框架的信息。 You can inspect what PostSharp "sees" by looking into C:\\ProgramData\\PostSharp\\InstalledFrameworks directory and on the latest XML file in there. 您可以通过查看C:\\ProgramData\\PostSharp\\InstalledFrameworks目录以及该目录中最新的XML文件来检查PostSharp“看到的内容”。

To solve this, please install Microsoft Build Tools 2013 on the build server. 要解决此问题,请在生成服务器上安装Microsoft Build Tools 2013。 Then, while configuring a build step in TeamCity, please make sure that you have Microsoft Build Tools 2013 and MSBuild 12.0 selected. 然后,在TeamCity中配置构建步骤时,请确保已选择Microsoft Build Tools 2013和MSBuild 12.0。 MSBuild from .NET 4.5 (Visual Studio 2012) will also work. .NET 4.5(Visual Studio 2012)中的MSBuild也可以使用。

This isn't really a PostSharp error — your build agent probably just doesn't have the correct version of Visual Studio installed. 这实际上不是PostSharp错误-您的生成代理可能只是没有安装正确版本的Visual Studio。 You can either install VS, or manually install the appropriate targeting pack on your build agents. 您可以安装VS,也可以在构建代理上手动安装适当的定向包 (That link is for VS2013. See the other links on that page if you're using other versions of VS.) (该链接适用于VS2013。如果您使用的是其他版本的VS,请参见该页面上的其他链接。)

It may help to know that "targeting packs" in this context are also known as ".NET SDKs." 在这种情况下,“目标包”也称为“ .NET SDK”可能会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM