Translate

Monday, March 23, 2015

MSBuild TransformXMl Task when converting from VS 2010 to VS 2012

Sometimes within a VS project Xml files are used to hold configuration settings for different build types, e.g., Debug vs. Release, etc.
A build warning will be displayed such as:
The "TransformXml task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Task.dll.

This warning means that you migrated your VS 2010 project into a VS 2012 solution successfully, but, forgot to change the references for VS 2010 MSBuild assemblies to VS 2012 ( which is v11.0 ).

To Fix:
- Unload the project in the VS 2012 IDE, and edit the project file.
- Change all Microsoft.Web.Publishing.Task.dll version v10.0 references to v11.0
- Change the $(MSBuildExtensionsPath) variable name to $(MSBuildExtensionsPath32)

- Save your edits and reload the project