How to fix '“CheckAttributes” task could not be loaded'-error after installing Visual Studio 2013 Update 4

*爱你&永不变心* 提交于 2019-12-03 03:30:39

问题


After installing Update 4, I now find myself unable to build (or even clean) any solution. I keep getting:

Error 1 The "CheckPathAttributes" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. HandlePageNotFound

Does anyone know how to resolve this please?


回答1:


Well, here's "my solution".

First the horrific "prompt of death" (plus the same "licensing issue" annoyance) in this post:

What I've attempted (and result) based on info from the interwebs:

  1. Close VS 2013 and rename the folder:
    C:\Users\[your user name]\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache

    Result: No effect/errors persist (VS will re-create that folder on startup)

  2. Rerun the Visual Studio Update 4 installer and Repair

    Result: Successfully "fixed" whatever it was.
    This will take about an hour which is slower than when I originally installed the update so that was a clue, or rather, more like "well, I hope that means it found what it did wrong or forgot/missed out on" (and not, "oh crap, now I'm really screwing things up even more")

A quick summary of my environment so that hopefully will guide you to your solution:

  • I did install Office Developer Tools Nov 2014 prior to the Update so in my case, that wasn't the issue (I did not remove/uninstall)

  • I have Resharper, and I did not disable it, so this too doesn't seem related (some have pointed this out)

  • I did update to Web Essentials 2013 for Update 4 after the initial Update (it will prompt you to after installing VS Update 4). I didn't do anything after the Repair (didn't remove/re-install/etc Web Essentials after the Repair).

  • I have VS 2012 as well, just mentioning this though that was never affected in any way (and was my fallback while this issue was stopping me from using VS2013)

Hth...




回答2:


Found the solution via this

TransformXml task could not be loaded from Microsoft.Web.Publishing.Tasks.dll

In my case, I had Visual Studio 2012 installed on an E: drive already, so I found a copy of Microsoft.Web.Publishing.Tasks in

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

So I copied that file, and Microsoft.Web.XmlTransform to here:

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

and now all is well :)




回答3:


Uninstalling "Office Developer Tools for Visual Studio 2013 – November 2014 Update" helped me. Now all works as before.




回答4:


If you have VS 2012 installed on your machine. Copy Microsoft.Web.Publishing.Tasks.dll and Microsoft.Web.Publishing.targets from C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\web\ into C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web (the path for VS 2013). Restart visual studio.




回答5:


I have only VS2013 (now with Update 4) and I solve this problem as follows: Close VS, copy "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.Dll" into the "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web" directory and start VS (folder v11.0 no contains Web subfolder). Now I can rebuild website projects without any error again.




回答6:


My problem cleared thanks to the same TransformXml link and the suggestion to install Windows SDK for Windows 7 and .NET Framework 4




回答7:


Copying "Microsoft.Web.Publishing.Tasks.dll" and "Microsoft.Web.XmlTransform.dll" from "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web" to "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web" also works



来源:https://stackoverflow.com/questions/26930376/how-to-fix-checkattributes-task-could-not-be-loaded-error-after-installing-v

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!