使用Mono在Linux上通过msbuild进行TransformXml任务失败 [英] TransformXml task fails via msbuild on linux using mono

查看:165
本文介绍了使用Mono在Linux上通过msbuild进行TransformXml任务失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按照此答案中的步骤进行操作之后,尝试通过mono(使用msbuild)构建项目时,我得到了以下错误:

After following the steps in this answer, when attempting to build a project through mono (Using msbuild), I get the following error:

(AfterCompile目标)-> project.csproj(469,5):错误MSB4062:无法从程序集/usr/lib/mono/xbuild/Microsoft/VisualStudio/v15.0/Web/Microsoft.Web.Publishing.Tasks中加载"TransformXml"任务.dll.确认声明正确无误,并且该程序集及其所有依赖项均可用,并且该任务包含实现Microsoft.Build.Framework.ITask的公共类.

(AfterCompile target) -> project.csproj(469,5): error MSB4062: The "TransformXml" task could not be loaded from the assembly /usr/lib/mono/xbuild/Microsoft/VisualStudio/v15.0/Web/Microsoft.Web.Publishing.Tasks.dll. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

显示为Microsoft.Web.Publishing.Tasks.dll不可用.

推荐答案

在Linux上通过mono,该文件不存在.要解决此问题,请按照下列步骤操作:

On linux via mono, this file doesn't exist. To solve this issue, follow these steps:

  1. 安装nuget包MSBuild.Microsoft.VisualStudio.Web.targets
  2. 右键单击您的项目,然后单击卸载项目"
  3. 右键单击您(现在已卸载)的项目,然后单击编辑MyProjectName.csproj"
  4. 替换此行:

<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" />

使用更新的nuget Microsoft.Web.Publishing.Tasks.dll位置(必要时更新MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3中的版本名称):

With your updated nuget Microsoft.Web.Publishing.Tasks.dll location (Update version name in MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3 as necessary):

<UsingTask TaskName="TransformXml" AssemblyFile="..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3\tools\VSToolsPath\Web\Microsoft.Web.Publishing.Tasks.dll" />

  1. 重新加载您的项目,瞧,在linux上工作!

这篇关于使用Mono在Linux上通过msbuild进行TransformXml任务失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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