NadunS Ответов: 1

Сбой сборки в исходном коде msbuild(https://github.com/Microsoft/msbuild)


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.


Что я уже пробовал:

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

Afzaal Ahmad Zeeshan

В вашем проекте отсутствуют файлы. Почини их, тогда это сработает. Возможно, вам захочется обновить зависимости.

1 Ответов

Рейтинг:
10

NadunS

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