Publish error: Could not load file or assembly 

2020-03-01 05:25发布

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.

13条回答
Fickle 薄情
2楼-- · 2020-03-01 05:34

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.

查看更多
家丑人穷心不美
3楼-- · 2020-03-01 05:35

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

查看更多
爷的心禁止访问
4楼-- · 2020-03-01 05:44

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.

查看更多
Melony?
5楼-- · 2020-03-01 05:45

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

查看更多
我欲成王,谁敢阻挡
6楼-- · 2020-03-01 05:46

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 !

查看更多
你好瞎i
7楼-- · 2020-03-01 05:47

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

查看更多
登录 后发表回答