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

StackOverflow https://stackoverflow.com/questions/23341714

Question

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.

Était-ce utile?

La solution 2

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.

Autres conseils

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

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

Have you tried using the Assembly Binding Log Viewer, this may give more information...

http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx

Download file from here: https://docs.google.com/file/d/0B8XrlgnW-cfISXd1Q0VQb0gtNk0/edit

and place it here: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web

Enjoy !

My situation seems to have been caused when I installed the Azure 1.1 SDK and components for Service Bus for windows. The publish to Azure kept failing for transformation errors, went back to some of my other projects that were just web package installs, and again those transforms failed for the same error, so now I have a bigger problem. My POC now is breaking my production deploys. I removed and re-installed Microsoft ASP.Net and WebTools 2013.v - Visual Studio 2012 from the control panel which did not help. Rebooted the machine and then just did a repair on the same component, and Voila, seems to work fine now.

I had a nearly identical problem, except the publish was saying it couldn't find Newtonsoft.Json.dll, Version=4.5.0.0. I tried all of the above solutions before finally realizing that the file was missing from the package directory for Azure WebJobs Publish (apologies for not having the full name of the package at my fingertips). The solution was simply to empty my entire /packages/ folder and let them restore automatically.

For me 'barca_d' solution worked but i also had to keep my projects

Hope my solution would help someone.

There was a installed program called "Microsoft ASP.NET and Framework 2012.2", uninstall it and then repair the Microsoft Visual Studio Professional 2012, works fine now

Installed Programs (Control Panel-->Programs and Features)

Microsoft .NET Framework 4.5

Microsoft ASP.NET MVC 3

Microsoft ASP.NET Web Pages

Microsoft Visual Studio Professional 2012 with update 5

Microsoft Web Deploy 3.5

Reinstall NuGet Package Microsoft.Web.Xdt

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top