.NET 4.0 build issues on CI server

33,852

Solution 1

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

Solution 2

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.

Solution 3

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

Share:
33,852

Related videos on Youtube

DMcKenna
Author by

DMcKenna

Updated on February 05, 2020

Comments

  • DMcKenna
    DMcKenna about 4 years

    Anybody manage to get .NET 4.0 applications compiling on a CI server without installing Visual Studio 2010 on a CI server?

    No SDK exists for .NET 4.0. Have installed .NET 4.0 on CI Server. Msbuild.exe works for simple projects and give the following warning:

    (GetReferenceAssemblyPaths target) -> C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(847,9): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

    • Colonel Panic
      Colonel Panic about 9 years
      How can I make this a fatal error rather than a warning? It's hidden in our build log and instead it fails further down with some cryptic message about mscorlib.dll
  • Admin
    Admin about 13 years
    The default install is 1.7 GB, but most of these files are unnecessary. If you un-check everything except .NET Development > Intellisense and Reference Assemblies that will still give you the .NET 4 targeting pack that you need (it's about 450 MB).
  • Mykro
    Mykro over 12 years
    You may also want to check .NET Development > Tools as that will bring in several utilities such as sn.exe that come in handy for dealing with signed assemblies.
  • Carl
    Carl over 12 years
    I downloaded the installer, and when I ran it, it said I had .net 4 installed already, but the Intellisense and Reference Assemblies was unchecked. Checking it, and installing those files seemed to fix the issue for me. The weird thing is, I've had this CI build working for months now, and it just started throwing this error today.
  • Louis Rhys
    Louis Rhys about 12 years
    this is just as big as visual studio express. So why not just install VS?
  • James
    James about 12 years
    2 reasons spring to mind. 1. because it is free and when you have to have multiple build servers those VS licences stack up. 2. if the server is headless and has to be automated then why would you want a gui on it?
  • Rasmus
    Rasmus about 12 years
    There is also a web installer so you only have to download the needed parts. Can be downloaded here: microsoft.com/download/en/confirmation.aspx?id=8279
  • Aligma
    Aligma over 11 years
    While this is named "for Windows 7" it is worth noting the Supported operating systems: Windows 7, Windows Server 2003 R2 Standard Edition (32-bit x86), Windows Server 2003 R2 Standard x64 Edition , Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP Service Pack 3
  • Chris
    Chris over 11 years
    From the referenced page: "The Windows SDK no longer ships with a complete command-line build environment. The Windows SDK now requires a compiler and build environment to be installed separately." So I assume this is not sufficient to run a build server.
  • ari
    ari over 10 years
    That answer help me. I had a diffrent problem installing sdk 7.1 which solved as shown here mathworks.com/matlabcentral/answers/95039
  • Koen Zomers
    Koen Zomers over 9 years
    This fixed it for me. You only have to select the option ".NET Framework 4.5 Software Development Kit" which requires only 62.3 MB and works fine on a TFS Build 2013 server installed on Windows Server 2012 R2 for SharePoint Apps deployment. No need to override the FrameworkPathOverride parameter.
  • chdev77
    chdev77 almost 8 years
    Since my 2012 server would not let me install .Net 4 because the installer said there is a higher version. I did what @kite said and copied from a PC I had were VS 2012 was installed. This resolved my issues.
  • Lex Li
    Lex Li about 4 years
    It can be a general tip to install developer pack or targeting pack, but specific to .NET Framework 4.0 (this question is all about) there is no such pack and Windows SDK is inevitable.