3

I have the following error on the build server for code that compiles and passes tests fine locally.

(150): The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

I've added the WebApplications folder from my local machine to the appropriate path on the build server but I'm still getting the same error on build.

I believe the recommended approach with TFS2008 was to install VS2008 in it's entirety on the build server. Is this still the case with TFS2010 and VS2010 accordingly? a.k.a Sledgehammer to crack a nut.

Darren Lewis
  • 8,338
  • 3
  • 35
  • 55
  • What, exactly, do you think is going to build your code, if not Visual Studio 2010? – John Saunders Apr 09 '11 at 01:42
  • @John Saunders How about TFS having installed the required components during install. – Darren Lewis Apr 09 '11 at 07:46
  • which components? How would it know which components you're going to need for your builds? – John Saunders Apr 09 '11 at 17:48
  • 3
    VS project files are just MSBuild files so I'd expect it to install all of the required MSBuild targets. You don't need VS to build a .NET project so I don't think it's reasonable to expect to have to install it on the build server. In a large build environment with many agents, that's a large maintenance overhead. If and when new targets are released out of band we should have a means of deploying these to the build environment without having to run VS install. – Darren Lewis Apr 09 '11 at 17:57
  • maybe you don't know. There are many editions of Visual Studio. Different editions install different target files, or at least they did. There used to be a "Visual C#" edition that was just C#. It had no VB.NET targets. More targets can be added by add-in products, some not even from Microsoft. If you don't install those on the build machine, you don't get the targets, or the assemblies, or possibly additional tools needed to do the builds. That even leaves out the question of licensing. – John Saunders Apr 10 '11 at 01:50
  • 1
    @John Saunders you might want to research a bit about using MSBuild ( provided by the .NET Framework not Visual Studio ) and related build engines without needing Visual Studio on your build box. It was the stated goal of Microsoft but many teams have failed to deliver thus unfortunatly needing Visual Studio in many situations. – Christopher Painter Mar 09 '12 at 15:54
  • @ChristopherPainter: I know MSBUILD very well, thanks. – John Saunders Mar 09 '12 at 17:59
  • 1
    Then what exactly did you mean by what's going to build your code it not VS2010? FWIW, I know the whole ALM space very, very well. The original intention from Microsoft with the .NET framework, CSC and MSBuild was that you shouldn't need Visual Studio to build your software. The different teams at DevDiv have done a horrible job at following this design though. – Christopher Painter Mar 09 '12 at 18:05

3 Answers3

3

Pretty much, especially if you plan on using other features like MSTest. You can try just adding the targets file but you'll probably still have some missing dependencies. You could go through the whole process of fixing the dependencies as you go along but it's probably easier just to install VS 2010 and be done with it.

James Reed
  • 13,873
  • 51
  • 60
2

This blog post seems to describe a way to do what you want without having to install additional software on the build server, if all you need is the .net compilers. It does not cover C++ compiler setup.

Warren P
  • 65,725
  • 40
  • 181
  • 316
friism
  • 19,068
  • 5
  • 80
  • 116
0

I discovered that if you're going to do just "standard" (i realize that's open to interpretation) web apps and non-web apps (e.g. services), you can get away with installing just Visual Studio 2010 Shell, plus Visual Studio 2010 SP1 on the build server. That will get you the missing .targets files.

Since a full VS install is required for advanced features, does anyone know if the build-server-install license cost is waived?

efisher
  • 223
  • 4
  • 12