TransformXml task could not be loaded from Microsoft.Web.Publishing.Tasks.dll

后端 未结 10 2219
醉话见心
醉话见心 2020-12-13 05:35

Has anyone seen this error and know how to fix it?

The \"TransformXml\" task could not be loaded from the assembly C:\\Program Files (x86)\\MSBuild\\M

10条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-13 06:00

    I've been combating this problem on our build server for several days, so I figured I'd document the resolution I came to. First, my build server has the web publishing extensions installed. I can use the TransformXml task to my heart's content inside of a web application project.

    To use it outside of a web application project, I tried to add the UsingTask element to my project and point it to the right place using ms build properties (as Benjamin demonstrated). However, they weren't there on my build server (those with easy access to the file system of their build server can probably skip this and just install the relevant package to Visual Studio). I even went so far as to hard code visual studio versions, but it always dropped that error on me.

    I finally gave up, pulled the DLLs from my local PC:

    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.XmlTransform.dll
    

    I uploaded them to source control and added that folder to my build's workspace (Edit Build Definition -> Source Settings -> Source Control Folder). From there, I don't even need to reference the folder -- here's what my UsingTask looks like:

      
    

    Now I can use the TransformXml task to my heart's content from any project.

提交回复
热议问题