MS-Build 2017"Microsoft.WebApplication.targets"不见了 [英] MS-Build 2017 "Microsoft.WebApplication.targets " is missing

查看:194
本文介绍了MS-Build 2017"Microsoft.WebApplication.targets"不见了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我们的构建服务器(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.

详细错误:

 error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets"

我在MS-Build目录中进行了查找:

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)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications


Mode                LastWriteTime         Length Name                                                                                                                                                                                                            
----                -------------         ------ ----                                                                                                                                                                                                            
-a----       11.01.2012     00:23          19654 Microsoft.WebApplication.targets                                                                                                                                                                                


    Directory: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications


Mode                LastWriteTime         Length Name                                                                                                                                                                                                            
----                -------------         ------ ----                                                                                                                                                                                                            
-a----       22.07.2013     01:25          19995 Microsoft.WebApplication.targets                                                                                                                                                                                


    Directory: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications


Mode                LastWriteTime         Length Name                                                                                                                                                                                                            
----                -------------         ------ ----                                                                                                                                                                                                            
-a----       06.07.2015     21:55          20118 Microsoft.WebApplication.targets                                                                                                                                                                                


    Directory: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\WebApplications


Mode                LastWriteTime         Length Name                                                                                                                                                                                                            
----                -------------         ------ ----                                                                                                                                                                                                            
-a----       22.07.2013     01:25          19995 Microsoft.WebApplication.targets

可以看出,该文件存在于旧的编译器版本中,但对于v15.0,则丢失了.

As can be seen the file exists for old compiler versions, but for v15.0 it is missing.

我还在构建服务器上安装了Visual Studio 2017.如果我使用Visual Studio 2017进行编译,则该项目将成功构建.

I also have installed Visual Studio 2017 on the build-server. The project succeeds to build if I compile with Visual Studio 2017.

任何提示如何解决此问题?一种可能的解决方案是从C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications点到旧的v14.0文件(位于C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications下)生成符号链接.

Any hints how to solve this problem? One possible solution is to generate a symbolic link from C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications point to the old v14.0 files (located under C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications).

Thx

推荐答案

好像您缺少"Web开发构建工具"的工作量:

Looks like you are missing the workload for "Web development build tools": Microsoft.VisualStudio.Workload.WebBuildTools.

您可以通过从此处(VS2017)或此处(VS2019),然后运行

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

或打开vs_buildtools.exe并在GUI中选择"Web开发构建工具"组件:

or opening vs_buildtools.exe and selecting the "Web development build tools" component in the GUI:

这篇关于MS-Build 2017"Microsoft.WebApplication.targets"不见了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆