在msbuild源代码中构建失败(https://github.com/Microsoft/msbuild) [英] Build fail in msbuild source code(https://github.com/Microsoft/msbuild)
本文介绍了在msbuild源代码中构建失败(https://github.com/Microsoft/msbuild)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从(https://github.com/Microsoft/msbuild)克隆了MSBuild源代码,然后按照以下步骤构建项目。
使用Visual Studio 2017构建MSBuild
>安装Visual Studio 2017.选择以下工作负载:
-.NET桌面开发
- 使用C ++进行桌面开发
可选,如果没有它,可能会发生构建警告。
- .NET核心跨平台开发
Otional,并非严格要求(尚未)但用于开发.NET核心应用程序。
>克隆源代码(见上文)。
>使用cibuild.cmd脚本构建代码。
>在Visual Studio 2017中打开src / MSBuild.sln解决方案
但是构建失败并出现以下错误
导入的项目C :\ buildbuildgit \ msbuild \packages \Nerdbank.GitVersioning\1.5.46 \ build \dotnet \ Nerdbank.GitVersioning.targets未找到。确认< Import>中的路径声明是正确的,并且该文件存在于磁盘上。 Microsoft.Build.CommandLine.UnitTests
导入的项目C:\\\ buildbuildgit \msbuild \packages \Nerdbank.GitVersioning \1.5.46 \ build \ network \ Nerdbank。没有找到GitVersioning.targets。确认< Import>中的路径声明是正确的,并且该文件存在于磁盘上。 Microsoft.Build.Engine.OM.UnitTests
以及以下项目未加载
Microsoft.Build
Microsoft.Build.Framework
Microsoft.Build.Tasks
Microsoft.Build.Utilities
MSBuildTaskHost
当我们尝试重新加载上述项目时出现以下错误
C:\ msbuildgit \msbuild\src\Build\Microsoft.Build.csproj:错误:导入的项目C:\msbuildgit \msbuild \packages \Nerdbank.GitVersioning \1.5没找到.46\build\dotnet\Nerdbank.GitVersioning.targets。确认< Import>中的路径声明是正确的,并且该文件存在于磁盘上。 C:\msbuildgit \ msbuild\src\dir.targets
请帮助我们。
我尝试了什么:
以下选项已经尝试过两个都失败了
试图恢复nuget包
尝试安装Nerdbank.GitVersioning nuget来自(https://www.nuget.org/packages/Nerdbank.GitVersioning/)
请注意cibuild.cmd脚本已经执行
解决方案
问题已解决按照以下步骤,Jeff Kluge在GitHub中提出此问题后帮助解决了这个问题(https://github.com/Microsoft/msbuild/issues/1947)
打开VS 2017开放式命令提示符
运行cd / d C:\ msbuildgit \ msbuild
运行git clean -xfd清理登记
运行cibuild.cmd --build-only来构建源代码
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
解决方案
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
这篇关于在msbuild源代码中构建失败(https://github.com/Microsoft/msbuild)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文