Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 975
barca_d Avatar asked Apr 28 '14 12:04

barca_d


6 Answers

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).

like image 161
Piedone Avatar answered Oct 11 '22 15:10

Piedone


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.

like image 43
barca_d Avatar answered Oct 11 '22 15:10

barca_d


Had that problem also. What worked for me was:

  • Uninstall Web Tools 2013.1 - Visual Studio 2012 at start / control panel / programs.
  • Install AspNetWebTools2013_1Setup.exe and WebToolsExtensionsVS.MSI from http://www.microsoft.com/en-us/download/details.aspx?id=41532.
like image 26
bicycle Avatar answered Oct 11 '22 15:10

bicycle


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.

like image 44
d.popov Avatar answered Oct 11 '22 13:10

d.popov


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).

like image 40
harvzor Avatar answered Oct 11 '22 15:10

harvzor


run VS12 in admin mode helped me after I tried all recommended above

like image 23
Andriy Ivaskevych Avatar answered Oct 11 '22 14:10

Andriy Ivaskevych