Search code examples
c#asp.net.netdependencies.net-assembly

Publish error: Could not load file or assembly 'Microsoft.Web.XmlTransform', Version=1.4.0.0, Culture=neutral, etc. or one of its dependencies


I want to publish a MVC project and I keep getting this error:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.XmlTransform', Version=1.4.0.0, Culture=neutral, PublicKeyToken=... or one of its dependencies. The system cannot find the file specified.

I have searched for and tried some solutions found on SO or MSDN to no avail. I'm really desperate for some suggestions. The project has been published successfully before, but this came out of the blue after trying to republish my updated version.


Solution

  • I finally got this to work. I'm leaving my solution here in case others have a similar issue.

    Basically I tried repairing my VS using the Microsoft ASP.NET and Web Tools 2013.1 (I got it from here Microsoft Web Tools download page). However, it didn't solve the problem for me. What did solve it was copying the file Microsoft.Web.XmlTransforms.dll from another machine at the location

    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web

    Somehow, mine was missing from there (I got it from another computer with the same .NET version and pasted it there) and now the publish works fine.