在构建服务器中构建可移植类库项目失败 [英] Building Portable Class Library Project in build server fails

查看:16
本文介绍了在构建服务器中构建可移植类库项目失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近向构建服务器中构建的应用程序添加了一些自定义可移植类库项目.构建工作正常,但之后它停止工作并向我显示以下消息:

<块引用>

C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets(983,5):警告 MSB3644:框架的参考程序集未找到.NETPortable,Version=v4.0,Profile=Profile136".

C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets(1578,5):警告 MSB3270:处理器之间存在不匹配正在构建的项目的架构MSIL"和处理器参考架构"C:WindowsMicrosoft.NETFramework64v4.0.30319mscorlib.dll",AMD64".

错误 CS0234:类型或命名空间名称Linq"在命名空间System"(您是否缺少程序集引用?)

构建服务器规范:

  • Windows Server 2008 R2 标准版
  • TeamCity 8.0.4
  • .NET 4.5
  • :

I've recently added some custom Portable Class Library projects to an application that is built in an build server. The build was working fine, but after that it stopped working and shows me the following messages:

C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets(983, 5): warning MSB3644: The reference assemblies for framework ".NETPortable,Version=v4.0,Profile=Profile136" were not found.

C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets(1578, 5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:WindowsMicrosoft.NETFramework64v4.0.30319mscorlib.dll", "AMD64".

error CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)

The build server specs:

The solution is a .NET 4.0 application and the portable projects target .NET4.0+ e Silverlight 5, only.

I have checked my development machine (Windows 8, Visual Studio 2012). There is indeed a folder "C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETPortablev4.0ProfileProfile136" (in fact, the profiles for .NET 4.0 go up to 158). In the build machine, however, there are only folders for profiles up to 131.

Is Portable Class Library Tools up to date? It seems it miss installing profiles for the most recent platforms.

UPDATE

I copied the ".NETPortablev4.0ProfileProfile136" of my development machine to the build server, and now the application builds successfully. I still would like to know why installing the Portable Class Library Tools does not work out of the box.

解决方案

A more general and elegant solution is to install the latest Microsoft .NET Portable Library Reference Assemblies. This will install profile138 among many others.

The standalone installer(s) can be found at:

这篇关于在构建服务器中构建可移植类库项目失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆