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
Just in case someone is using an SDK-style csproj, you can achieve this without having to install Visual Studio on the build server.
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
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
Import the SlowCheetah targets into your project:
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.