Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.Tasks.dll.

Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.Tasks.dll' or one of its dependencies. The system cannot find the file specified.

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.

I read elsewhere that the problem is when you don't have SQL Server installed. But I do have SQL Express 2012 x64 installed with SP1. I am also running VS 2013 Professional.

I have ran this exact same solution in VS 2012 express with no problems.

like image 671
allencoded Avatar asked Dec 03 '13 18:12

allencoded


3 Answers

The answers provided by Dai Bok and emalamisura work fine as long as you use Visual Studio 2012. For VS 2013 this fails as well. In order to make this work with all versions of Visual Studio you should:

  • Open the project file (.csproj) of the project failing to load
  • Search for <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets" />
  • Change it to <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.targets" />
  • Reload the project

That will set the correct version of Visual Studio dynamically and properly.

like image 200
Ben Sch Avatar answered Oct 20 '22 10:10

Ben Sch


To get mine to work, I just copied my v10.0 folder and renamed it to v11.0, and things seems to work well from then on. That's the quick fix for now.

As this is probably not the best solution, and although it works, I was going to try installing the Microsoft Windows SDK for Windows 7 and .NET Framework 4 Windows SDK for Windows 7 and .NET Framework 4, but it is taking to long to download.

like image 30
Dai Bok Avatar answered Oct 20 '22 10:10

Dai Bok


To fix the issue,

  1. Find the Visual studio Installer in your computer
  2. Click or tap to start the installer, and then select Modify.
  3. From the Individual Components screen, select Asp.net and web development tools and then select Modify/Install.

This solved the issue as it creates the dll's in the mentioned path.

like image 11
Vinodhini Ramasamy Avatar answered Oct 20 '22 10:10

Vinodhini Ramasamy