Search code examples
msbuildtfsbuildbuild-error

TFS 2010 build error - imported project "project_path" was not found


Have been trying to build a solution which contains a number of projects and keep getting a recurring error.

I have managed to get the build to partially succeed but always get the error shown below:

C:\Builds\1\MBS.Payments.Forms.Mvc\MBS Payment Forms MVC\Sources\MBS.Payments.Forms.Mvc\MBS.Forms.Payments.Web\MBS.Forms.Payments.Web.csproj (979): The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.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 have navigated to the file in which the error is being generated where this code is highlighted:

<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets"  Condition="'$(VSToolsPath)' != ''" />

Currently I have both Visual Studio 2010 Premium and a evaluation version of Visual Studio 2012 Ultimate installed, I am currently working on this application in Visual Studio 2010.

below is the code block in which the erroneous code is found:

<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

Please could anyone advise on why this error is being generated and how it could be resolved.


Solution

  • the <PropertyGroup></PropertyGroup> tag gets added to the project file when you open it in Visual Studio 2012, I was able to open the project file in a text editor, remove the PropertyGroup and it built successfully