MS-Build 2017 “Microsoft.WebApplication.targets"不见了 [英] MS-Build 2017 "Microsoft.WebApplication.targets " is missing
问题描述
我正在尝试将我们的构建服务器 (jenkins) 从 Visual Studio 2015 升级到 2017.我们正在通过 MS-Build 构建.我已经按照
I'm trying to upgrade our buildserver (jenkins) from Visual Studio 2015 to 2017. We're building via MS-Build. I've downloaded and installed MS-Buld tools as described in this answer. If I compile my projects I get an error that Microsoft.WebApplication.targets
was not found.
Detailed error:
error MSB4226: The imported project "C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuildMicrosoftVisualStudiov15.0WebApplicationsMicrosoft.WebApplication.targets"
I performed a find in the MS-Build directory:
PS C:Program Files (x86)MSBuild> dir -Recurse -Filter "Microsoft.WebApplication.targets"
Directory: C:Program Files (x86)MSBuildMicrosoftVisualStudiov11.0WebApplications
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 11.01.2012 00:23 19654 Microsoft.WebApplication.targets
Directory: C:Program Files (x86)MSBuildMicrosoftVisualStudiov12.0WebApplications
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 22.07.2013 01:25 19995 Microsoft.WebApplication.targets
Directory: C:Program Files (x86)MSBuildMicrosoftVisualStudiov14.0WebApplications
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 06.07.2015 21:55 20118 Microsoft.WebApplication.targets
Directory: C:Program Files (x86)MSBuildMicrosoftVisualStudioWebApplications
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 22.07.2013 01:25 19995 Microsoft.WebApplication.targets
As can be seen the file exists for old compiler versions, but for v15.0 it is missing.
I also have installed Visual Studio 2017 on the build-server. The project succeeds to build if I compile with Visual Studio 2017.
Any hints how to solve this problem? One possible solution is to generate a symbolic link from C:Program Files (x86)MSBuildMicrosoftVisualStudiov15.0WebApplications
point to the old v14.0 files (located under C:Program Files (x86)MSBuildMicrosoftVisualStudiov14.0WebApplications
).
Thx
Looks like you are missing the workload for "Web development build tools": Microsoft.VisualStudio.Workload.WebBuildTools
.
You can install it by downloading the build tools installer from here (VS2017) or here (VS2019) then running
vs_buildtools.exe --add Microsoft.VisualStudio.Workload.WebBuildTools
or opening vs_buildtools.exe
and selecting the "Web development build tools" component in the GUI:
这篇关于MS-Build 2017 “Microsoft.WebApplication.targets"不见了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!