为了账号安全,请及时绑定邮箱和手机立即绑定

在构建服务器上找不到Microsoft.WebApplication.你的解决方案是什么?

在构建服务器上找不到Microsoft.WebApplication.你的解决方案是什么?

守着一只汪 2019-09-18 14:38:18
尝试在构建服务器上构建我的项目给出了以下错误:Microsoft (R) Build Engine Version 4.0.30319.1error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.几个月前,我在Build Server上安装了Visual Studio 2010,解决了这个问题。但是现在我从头开始设置一个新的服务器,我想知道是否有更好的解决方案来解决这个问题。
查看完整描述

3 回答

?
catspeake

TA贡献1111条经验 获得超0个赞

要回答问题的标题(但不是关于你得到的输出的问题):


将以下文件夹从您的开发计算机复制到您的构建服务器,如果它只是Web应用程序,则会修复此问题


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


根据构建中断的方式删除x86。如果您有其他项目类型,则可能需要复制整个msbuild文件夹。


查看完整回答
反对 回复 2019-09-18
?
郎朗坤

TA贡献1921条经验 获得超9个赞

如果未安装VS,则不支持构建和发布WAP。话虽如此,如果你真的不想安装VS那么你需要复制下的所有文件%ProgramFiles32%\MSBuild\Microsoft\。


您还需要安装Web Deploy Tool。我想就是这样。


查看完整回答
反对 回复 2019-09-18
?
慕盖茨4494581

TA贡献1850条经验 获得超11个赞

UPD:从VS2017开始,Build Tools中的工作负载完全消除了这个问题。请参阅@SOReader答案。


如果您不想在构建服务器上修改任何内容,并且仍希望项目能够直接从源代码控制中构建,那么将所需的二进制文件置于源代码管理之下可能是个好主意。您需要修改项目文件中的imports部分,如下所示:


<Import Project="$(SolutionDir)\BuildTargets\WebApplications\Microsoft.WebApplication.targets" />

<Import Condition="false" Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

第一行是相对于解决方案目录的新位置的实际导入。第二个是Condition="false"原始行的关闭版本(),允许Visual Studio仍将您的项目视为有效的Web应用程序项目(这是VS 2010 SP1自身的技巧)。


不要忘记复制源代码管理下的C:\Program Files (x86)\Microsoft\VisualStudio\v10.0\WebApplicationsto BuildTargets文件夹。


查看完整回答
反对 回复 2019-09-18
  • 3 回答
  • 0 关注
  • 1590 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信