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.
Repairing "Microsoft ASP.NET and Web Tools 2013.1 - Visual Studio 2012" from Control Panel re-added the dll for me (what was missing, apparently after I updated the said package a few weeks ago).
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.
Had that problem also. What worked for me was:
Repairing MS Web Tools for VS2012 did not solve the problem for me.
I have the files in the folder C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web
(I do not know if this is because I have installed VS 2013 Express, or some other tool. Maybe installing the Web Tools for VS 2013 will create them).
Copying the files from v12.0
folder to v11.0
folder fixed the problem.
This may be an edge case, but I cloned I co-workers GIT repo containing a Visual Studio solution.
Visual Studio was reporting that the Microsoft.Web.XmlTransform.dll
reference was broken.
Looking at the .csproj
file for that project I found this:
<HintPath>..\..\..\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.XmlTransform.dll</HintPath>
This path must have been correct for my co-worker, but for me it was wrong. I corrected to this:
<HintPath>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.XmlTransform.dll</HintPath>
This occured with VS2015 (Version 14 Update 2).
run VS12 in admin mode helped me after I tried all recommended above
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With