Click here to Skip to main content
14,870,673 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have cloned MSBuild source code from (https://github.com/Microsoft/msbuild) and followed below steps to build the project.

Building MSBuild with Visual Studio 2017

>Install Visual Studio 2017. Select the following Workloads:
          -.NET desktop development
          - Desktop development with C++
            Optional, build warnings may occur without it.
          - .NET Core cross-platform development
             Otional, not strictly required (yet) but used to develop .NET Core applications.
>Clone the source code (see above).
>Build the code using the cibuild.cmd script.
>Open src/MSBuild.sln solution in Visual Studio 2017


But build is getting failed with following errors

The imported project "C:\msbuildgit\msbuild\packages\Nerdbank.GitVersioning\1.5.46\build\dotnet\Nerdbank.GitVersioning.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.	Microsoft.Build.CommandLine.UnitTests	

The imported project "C:\msbuildgit\msbuild\packages\Nerdbank.GitVersioning\1.5.46\build\dotnet\Nerdbank.GitVersioning.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.	Microsoft.Build.Engine.OM.UnitTests			


and also following projects are not getting loaded

Microsoft.Build
Microsoft.Build.Framework
Microsoft.Build.Tasks
Microsoft.Build.Utilities
MSBuildTaskHost

getting following error , when we try to reload above projects


C:\msbuildgit\msbuild\src\Build\Microsoft.Build.csproj : error  : The imported project "C:\msbuildgit\msbuild\packages\Nerdbank.GitVersioning\1.5.46\build\dotnet\Nerdbank.GitVersioning.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.  C:\msbuildgit\msbuild\src\dir.targets



Please help us on this.


What I have tried:

following options have been tried and both were getting failed

tried restoring nuget packages
tried installing Nerdbank.GitVersioning  nuget from (https://www.nuget.org/packages/Nerdbank.GitVersioning/)

Please note that cibuild.cmd script has been already executed
Posted
Updated 6-Apr-17 7:04am
v2
Comments
Afzaal Ahmad Zeeshan 5-Apr-17 12:10pm
   
There are files missing in your project. Fix them, it would work then. Perhaps, you might want to refresh the dependencies.

1 solution

Issue has been resolve by following below steps ,Jeff Kluge helped on this after raising this issue in GitHub(https://github.com/Microsoft/msbuild/issues/1947)

Open Developer Command Prompt for VS 2017
Run cd /d C:\msbuildgit\msbuild
Run git clean -xfd to clean the enlistment
Run cibuild.cmd --build-only to build the source code
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900