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

后端 未结 10 2199
醉话见心
醉话见心 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:13

    Just in case someone is using an SDK-style csproj, you can achieve this without having to install Visual Studio on the build server.

    1. First you should install the SlowCheetah nuget package to your project. Once you install it, you'll see the following in your SDK-style project.

      
              all
              runtime; build; native; contentfiles; analyzers
      
      
    2. Then make sure you add the GeneratePathProperty="true" attribute (see below). This is very important for the next part because it'll help you grab the path of where the nuget package is restored on your machine. George Dangl explains it in his article here.

      
              all
              runtime; build; native; contentfiles; analyzers
      
      
    3. Import the SlowCheetah targets into your project:

      
      
    4. You can now use an target command (in this case after publish) to apply some custom transformations. If you need to, you can always hard-code the file names below instead of using the variables in the below example.

      
           
      
      

    If you haven't used SlowCheetah before, I recommend checking it out. They have a Visual Studio extension that will make it easier for you to preview transform files.

提交回复
热议问题