72

When starting Visual Studio 2013 Pro (Update 4 installed) I very often get this error message (several times a day now) for the past about two weeks:

The 'Microsoft.VisualStudio.Editor.Implementation.EditorPackage' package did not load correctly.

I know I can correct this problem by closing Visual Studio and deleting:

%LocalAppData%\Microsoft\VisualStudio\12.0\ComponentModelCache

I have never seen it before that time and as far as I found out in the Internet it was possibly introduced with Update 3.

Well, the problem is that it is annoying to restart Visual Studio several times a day, and I was wondering if anyone else is experiencing this and knows how to solve it for good or what the cause is.

I noticed that it happens extremely often if I work in more than one instance of Visual Studio in parallel. This one is a killer. But still I suspect a third-party component to be involved or it is the size of one of the solutions (about 70 projects). I tried to deactivate some extensions I newly installed and need for the big project, but to no avail.

Just as information: I am working with C#. When working in parallel with projects open in several instances of Visual Studio I never had problems before.

Does anyone have the same problem to this extend or possibly have a better solution than deleting the folder and restarting?

The Bearded Llama
  • 3,036
  • 4
  • 20
  • 31
Uwe Hafner
  • 4,889
  • 2
  • 27
  • 44
  • Do you mean deleting the content of folder "ComponentModelCache" ***and*** "ComponentModelCache" ifself? Or just deleting the content of "ComponentModelCache" (leavning an empty folder)? – Peter Mortensen Jun 08 '15 at 15:31
  • 1
    Thank you very much for the tip with ***%LocalAppData%\Microsoft\VisualStudio\12.0\ComponentModelCache*** (in my case, for Visual Studio 2012, it was ***%LocalAppData%\Microsoft\VisualStudio\11.0\ComponentModelCache***). It fixed a crashing Visual Studio on an old imported Visual Studio 2008 solution. I deleted (actually, I moved it so it could be restored if necessary) the entire folder. – Peter Mortensen Jun 08 '15 at 15:42
  • 1
    @PeterMortensen: I started moving the folder just like you to be safe. Now if I get the error nowadays I just delete the ComponentModelCache folder completely not just the contents. – Uwe Hafner Jun 08 '15 at 20:17
  • I only have this problem with projects that use TypeScript. Maybe it's always TypeScript that causes this issue, I would like to hear from anyone else that can confirm. If we can narrow this down maybe we can get Microsoft to come up with a permanent fix. – bikeman868 Jul 06 '16 at 18:33
  • @bikeman868. Sorry. Can't confirm. I only use c#. No Web or Javascript back then when this issue happened really often. But I suspected some add-ons or libraries I was usually not using. But could not confirm that as well. – Uwe Hafner Jul 09 '16 at 15:35
  • This triggered on one of my dev machines after a windows 10 auto update. – Travis J Nov 06 '17 at 08:04

3 Answers3

127

This has become a popular question so I thought I add an explicit answer how to (at least) temporarily fix the problem as already stated in the question:

I stop Visual Studio and delete the following folder (completely, not just contents)

%LocalAppData%\Microsoft\VisualStudio\12.0\ComponentModelCache

If you are using VS2015, then the path should be:

%LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache

If you are using VS2017, then the path should be:

%LocalAppData%\Microsoft\VisualStudio\15.0\ComponentModelCache

I don't keep a backup of the folder. It is created automatically again when starting Visual Studio.

I have never found a solution how to permanently fix the problem in that working environment. In my new developing environment (new projects and new workplace) the problem never happens.

Jesse
  • 3,522
  • 6
  • 25
  • 40
Uwe Hafner
  • 4,889
  • 2
  • 27
  • 44
  • Thank you for the suggestion @Uwe, It might be worth updating your answer to say that this works for VS2015 Update 3 as well! Had the same issue crop up with a number of packages including the one referenced in the title. Repair and restart didn't fix the problem, but your suggestion did – The Bearded Llama Jul 08 '16 at 09:35
  • @TheBeardedLlama. Thanks for the update. I haven't had the issue with VS2015 yet. But sad it hasn't been fixed yet. – Uwe Hafner Jul 09 '16 at 15:36
  • i had the issue on VS2015 with update 3 and the latest hotfixes... clearing the folder seemed to resolve the issue – Raj Aug 03 '16 at 06:30
  • That's funny. Your solution sped up a lot the loading of my VS2013 solutions! – krlzlx Sep 12 '16 at 08:25
  • deleting just the content wasn't working for me. came across this finally. Thanks a lot! – Pallavi Oct 18 '16 at 14:06
  • One thing to note, is that if you are using something other than Visual Studio then you will need to remove the relevant folder. For example, I had this issue with a small test environment in Visual Studio Web Express, and the folder location was \microsoft\VWDExpress . The fix still worked though, thanks :) – Travis J Nov 06 '17 at 08:03
  • Unfortunately deliting the folder doesn't work for me :( – Roesmi Mar 28 '18 at 13:26
  • @Miquel Out of curiosity: What version of Visual Studio are you using? – Uwe Hafner Apr 04 '18 at 06:03
16

This is what helped me... seemed to happen after Windows Server 2012 SP install...

https://connect.microsoft.com/VisualStudio/feedback/details/1123745/setsite-failed-for-package-microsoft-visualstudio-editor-implementation-editorpackage

  1. devenv /clearcache
  2. devenv /updateconfiguration
Machavity
  • 30,841
  • 27
  • 92
  • 100
  • This one helped for me, since this error message was also in the ActivityLog.xml. Didn't get the error back. – Dacker Jul 26 '16 at 20:15
  • That helps. Also was interesting to read: https://msdn.microsoft.com/en-us/library/xee0c8y7.aspx – Roman Pokrovskij Sep 22 '16 at 15:42
  • Thanks! I had the same problem with visual studio preview 15 after installing ReSharper and then CodeMaid. Your solution worked. – Nico Oct 11 '16 at 06:45
  • 1
    This solution fixed this issue with Visual Studio 2017. I opened the command prompt, navigated to the location where Visual Studio (devenv.exe) is installed: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE and executed the two commands above. – Mobile Dan Jul 11 '18 at 03:10
  • This one worked for me. I had the error after a Windows Update. I remembered having something similar before and deleting the ComponentModelCache folder fixed it then. This time though, there was no ComponentModelCache Folder there to delete! Issuing these commands seems to have fixed it again. – Phil Preen Sep 18 '19 at 10:46
1

In that case you can start Visual Studio setup again and choose the option showing two options, Repair and Uninstall. Then click Repair and when repair is done, restart the computer. Then the issue has been resolved.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • Could you expand on this answer? More information would be good for others with the same issue. Read here for information on how to give a good answer http://stackoverflow.com/help/how-to-answer – Rich Benner Jun 03 '16 at 07:09
  • I don't know about current VS versions but with earlier versions I had the problem that calling repair or using setup startup options messed up my installed add-ons/ integrated third party products and/or settings and I had to reconfigure them. So I am usually reluctant to use that. – Uwe Hafner Jun 03 '16 at 07:22