.NET 4.0在 CI 服务器上构建问题

任何人想办法。NET 4.0应用程序在 CI 服务器上编译而不在 CI 服务器上安装 Visual Studio 2010?

没有 SDK 存在。NET 4.0.已安装。在 CI 服务器上使用 NET 4.0。Exe 适用于简单的项目,并给出以下警告:

(GetReferenceAssemblyPath 目标)-> C: Windows Microsoft.NET Framework v4.0.30319 Microsoft。Target (847,9) : 警告 MSB3644: 框架的引用程序集”。找不到 NETFramework,Version = v4.0”。要解决这个问题,请为此框架版本安装 SDK 或 TargetingPack,或者将应用程序重定向到已安装 SDK 或 TargetingPack 的框架版本。请注意,程序集将从全局程序集缓存(GAC)解析,并将用于代替引用程序集。因此,您的程序集可能无法正确地针对所要使用的框架。

34338 次浏览

You don't need to install VS anymore, you can install the "Microsoft Windows SDK for Windows 7 and .NET Framework 4" now.

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b

other alternative: without installing Net 4.0 SDK or vs 2010

Copy the reference assemblies folder from your dev machine to build server(190MB).

use msbuild -p:FrameworkPathOverride option to point to reference assemblies folder

the reference assemblies location:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0 or C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0

found this from:

.NET 4.0 build server reference assemblies warnings MSB3644

If you get this error: "Microsoft.WebApplication.targets was not found" - just copy the target from dev machine https://stackoverflow.com/a/5344246/423356

if mvc3 is not installed in build server; "add deployable assemblies" to the mvc project http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx

If you have error building the MSTest project without the sdk or visual studio installed; There are several blog post about this, to bad the solution is too complex for me. I use NUnit instead of MSTest

SDK for .NET 4.5 available here. Installer works well with proxy with basic authorization. Supported Operating Systems: Windows 8, Windows Server 2012, Windows 7, Windows Server 2008 R2

P.S. My answer is more like a comment to Jeremy answer, but I have not enough reputation to comment on the answers.

This page lists .NET SDKs for each Visual Studio version. http://blogs.msdn.com/b/dotnet/p/dotnet_sdks.aspx

For a smaller download choose the 'developer pack' or 'targeting pack' rather than the full Windows SDK.