100

The problem

I had Visual Studio 2015 RC installed and installed Visual Studio 2015 RTM over it. I couldn't find anything on the Internet that said you couldn't do this. I don't know if this is relevant to the problem.

Unfortunately, when I started up Visual Studio 2015 RTM for the first time after restarting it popped up message boxes with:

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

Also:

  • XamarinShellPackage
  • TestWindowPackage
  • NuGetPackage
  • ErrorListPackage

How can I resolve this error?

Logs

It said to look in the ActivityLog.xml. I couldn't find Microsoft.VisualStudio.Editor.Implementation.EditorPackage.

But for XamarinShellPackage it said:

<entry>
    <record>339</record>
    <time>2015/07/21 13:01:54.011</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>SetSite failed for package [XamarinShellPackage]</description>
    <guid>{2D510815-1C4E-4210-BD82-3D9D2C56C140}</guid>
    <hr>80070057 - E_INVALIDARG</hr>
    <errorinfo>'providers' cannot contain a null (Nothing in Visual Basic) element.
Parameter name: providers</errorinfo>
  </entry>
  <entry>
    <record>340</record>
    <time>2015/07/21 13:01:54.013</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>End package load [XamarinShellPackage]</description>
    <guid>{2D510815-1C4E-4210-BD82-3D9D2C56C140}</guid>
    <hr>80070057 - E_INVALIDARG</hr>
    <errorinfo>'providers' cannot contain a null (Nothing in Visual Basic) element.
Parameter name: providers</errorinfo>
  </entry>

For TestWindowPackage:

<entry>
   <record>394</record>
   <time>2015/07/21 13:02:02.751</time>
   <type>Error</type>
   <source>TestWindowPackage</source>
   <description>TestWindowPackage.Initialize failed with exception:
&#x000D;&#x000A;&#x000D;&#x000A;System.NullReferenceException:
Object reference not set to an instance of an object.&#x000D;&#x000A;
at Microsoft.VisualStudio.TestWindow.VsHost.TestWindowPackage.Initialize()
&#x000D;&#x000A;&#x000D;&#x000A;PackageContainer loaded: False &#x000D;&#x000A;</description>
</entry>
<entry>
   <record>395</record>
   <time>2015/07/21 13:02:02.752</time>
   <type>Error</type>
   <source>VisualStudio</source>
   <description>SetSite failed for package [TestWindowPackage]</description>
   <guid>{BFC24BF4-B994-4757-BCDC-1D5D2768BF29}</guid>
   <hr>80004003 - E_POINTER</hr>
   <errorinfo>Object reference not set to an instance of an object.</errorinfo>
</entry>

For NuGetPackage:

 <entry>
    <record>405</record>
    <time>2015/07/21 13:02:04.096</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>SetSite failed for package [NuGetPackage]</description>
    <guid>{5FCC8577-4FEB-4D04-AD72-D6C629B083CC}</guid>
    <hr>80004003 - E_POINTER</hr>
    <errorinfo>Object reference not set to an instance of an object.</errorinfo>
  </entry>
  <entry>
    <record>406</record>
    <time>2015/07/21 13:02:04.096</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>End package load [NuGetPackage]</description>
    <guid>{5FCC8577-4FEB-4D04-AD72-D6C629B083CC}</guid>
    <hr>80004003 - E_POINTER</hr>
    <errorinfo>Object reference not set to an instance of an object.</errorinfo>
  </entry>

For ErrorListPackage it said:

<entry>
    <record>409</record>
    <time>2015/07/21 13:02:04.624</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [ErrorListPackage]</description>
    <guid>{4A9B7E50-AA16-11D0-A8C5-00A0C921A4D2}</guid>
  </entry>
  <entry>
    <record>410</record>
    <time>2015/07/21 13:02:04.629</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>SetSite failed for package [ErrorListPackage]</description>
    <guid>{4A9B7E50-AA16-11D0-A8C5-00A0C921A4D2}</guid>
    <hr>80004003 - E_POINTER</hr>
    <errorinfo>Object reference not set to an instance of an object.</errorinfo>
  </entry>

What I have tried so far

So... Any suggestions out there?

Updates to the question

First update

I just tried to load a project and... Something is very wrong. It can't load a bunch of packages like: "CSharpPackage, IntegrationPackage, MigrationPackage, FileIndicatorPackage, etc..." and the Solution Explorer is completely blank! What is going on?

Second update

This is how my Programs and Features look like:

Screenshot of Programs and Features

Third update

I have uninstalled and removed as much as I dared.

  • Removed everything in AppData\Roaming\Microsoft\VisualStudio\14.0
  • Removed everything in AppData\Local\VisualStudio\14.0
  • Uninstalled Visual Studio 2015 via Programs and Features (above screenshot)
  • Removed the Visual Studio Secondary Installer folder in the Program Files folder altogether
  • Removed everything that has to do with Visual Studio 14.0 from Program Files

I don't want to mess up my Visual Studio 2013 installation. Visual Studio 2015 still can't load the packages above!

So if anyone has more information as to which programs exactly can be uninstalled from the above screenshot, I would be very happy.

Fourth update

Steps to be taken (updated from update 3)

  • Removed everything in AppData\Roaming\Microsoft\VisualStudio\14.0
  • Removed everything in AppData\Local\VisualStudio\14.0
  • Remove everything concerning Visual Studio 14.0 from ProgramData
  • Uninstalled Visual Studio 2015 via Programs and Features (above screenshot)
  • Did everything this article says: https://support.microsoft.com/nl-nl/kb/3016536
  • Removed the Visual Studio Secondary Installer folder in the Program Files folder altogether
  • Removed anything that has to do with Visual Studio 14.0 from Program Files basically. Anything left over from uninstalling in Programs And Features.
  • Uninstall Microsoft Visual C++ redistributable (x86) - 14.0.xxx also
  • Uninstalled my Xamarin stuff also
  • Hope I didn't forget anything, but bottom line is to totally get rid of anything Visual Studio 2015 related.
  • Reinstall Visual Studio 2015 RTM and it should work now. I have to install some third-party stuff again, but at least it works!
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Danny van der Kraan
  • 5,344
  • 6
  • 31
  • 41
  • 1
    Had a similar error. VS would not repair, I ended up doing a complete uninstall of both, and then reinstall. Works now. – James Parsons Jul 21 '15 at 19:33
  • Thnx for your comment. What do you mean with uninstall both? Because I don't see VS2015 RC anymore, I only see VS2015 RTM. – Danny van der Kraan Jul 21 '15 at 19:47
  • Apparently, VS 2015 RC, left some files over, I had to hunt those down. – James Parsons Jul 21 '15 at 19:55
  • Have the same issue updating from RC to final release. @James_Parsons could you mention those files? This is really frustrating! – Pantelis Jul 21 '15 at 20:25
  • Actually, after uninstallation, this was opened: https://support.microsoft.com/en-us/kb/3060695 – James Parsons Jul 21 '15 at 20:28
  • :P I was really, excited for the 2015 release, but it has been a pain so far – James Parsons Jul 21 '15 at 20:32
  • 1
    Also, be sure to search Program Files, Program Files (x86), and AppData for VS remnants. I still had VS 2012 stuff left over – James Parsons Jul 22 '15 at 00:41
  • Thanks for keeping involved James_Parsons. I added a screenshot of all the programs that got added/updated by the VS2015 install. Now with that Microsoft update I should be able to restore it (doing that later today). Do the VS2012 stuff stop VS2015 from working? Because I had VS2015 RC and VS2013 running side by side... – Danny van der Kraan Jul 22 '15 at 06:17
  • @James_Parsons Like Pantelis asked by the way, could you please name the folders/files/programs you deleted/uninstalled please? – Danny van der Kraan Jul 22 '15 at 07:32
  • @TLRonin, when uninstall finishes, a link of a KB article opens on your browser with details about how to completely uninstall. My case was different though. Even after uninstalling and installing again I had the same issues. I eventually, uninstalled and deleted all content of Visual Studio folders in %AppData% Local, Roaming and Program Files x86. Re-installed a third time and have a working VS back again. Folders deletion is not recommended, so do it at your own risk. – Pantelis Jul 22 '15 at 08:45
  • @Pantelis Thanks for replying. What a coïncidance. See update 3. Well, I must've missed something. I'll try it again. Pretty frustrating this experience. – Danny van der Kraan Jul 22 '15 at 08:52
  • @TLRonin totally. Deleting the folders manually will probably mess up 3rd party components. I had to re-install DevExpress for instance. At least Visual Studio is back and running again. Will report if I find anything unusual during usage. – Pantelis Jul 22 '15 at 09:06
  • @Pantelis Thanks. Another quick question though. When you said "deleted all content of Visual Studio folders" did you mean "14.0" only, or also previous versions? Like "12.0" for instance? – Danny van der Kraan Jul 22 '15 at 09:38
  • @TLRonin I had only the 2015 RC installed. I got a new disk recently and a clean windows installation and didn't bother installing 2013 since the next version was going to be released a couple of weeks later. Don't mess with your other visual studio installations though. 12.0 folder is for VS 2013. – Pantelis Jul 22 '15 at 09:58
  • @Pantelis Yeah I know, that's why I thought I ask first. Don't want to mess with my prior versions. ;-) Ok thanks Pantelis and James_Parsons! Your comments combined I found all the VS2015 stuff and was able to uninstall/delete everything and reinstall it. It seems to work now. Hopefully no nasty suprises in the nearby future. Updated question accordingly. – Danny van der Kraan Jul 22 '15 at 10:57
  • 3
    Someone please tell me MS is aware of this issue, and is doing something to fix it! This SO question is the only mention of the issue I'm able to find. Nothing I've tried works. I followed every step listed on here, and I STILL can't open VS. I'm STILL getting the unable to load package errors. – Tyler Jones Jul 31 '15 at 23:07
  • 1
    @Tyler Jones: Have you uninstalled EVERYTHING VS2015 RELATED in Programs & Features? – Danny van der Kraan Aug 03 '15 at 06:06
  • @TLRonin yes, i sorted by date, and uninstalled every item installed on the date I installed VS2015. – Tyler Jones Aug 09 '15 at 05:12
  • I've encountered the similar symptoms and unfortunately wasn't able to recover from it without complete OS re-install. I did everything from the post but w/o any success. I've create topic on msdn but as usual i didn't get anything interesting from support [link](https://social.msdn.microsoft.com/Forums/vstudio/en-US/6f3c71fa-410d-4df6-83f4-42a6e0ff9b44/page-312e8a59271248a1863e0ef4e67961fc-not-found-complete-reinstall-didnt-help?forum=vssetup) – RR-Fireball Jul 15 '16 at 14:07
  • You also might want to remove all related Windows Kits, i.e. C:\Program Files (x86)\Windows Kits\10 – romanoza Nov 20 '16 at 11:11
  • 1
    You shouldn't try to answer your question at the end of the question. If you want, add a new answer yourself. – ANeves Jun 30 '17 at 13:50

11 Answers11

191

I have Visual Studio 2012, 2013 and 2015 all installed on my machine. After installing Visual Studio 2013 Update 5, I started getting the "package did not load correctly" error in VS 2013.

All I did to get it working was to follow this step:

  1. Close all instances of Visual Studio
  2. Delete everything in this folder C:\Users\%username%\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache
  3. Restart Visual Studio

Though I have not tried this for Visual Studio 2015, I believe this should solve the problem too. To do this for Visual Studio 2015, 12.0 should be changed to 14.0.

UPDATE

Instead of deleting everything in the folder (as suggested by step 2 above), it is much more safer to rename the folder and allow Visual Studio create a new one. Sometimes, you might have to copy somethings over from the old folder.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Shittu Joseph Olugbenga
  • 6,396
  • 5
  • 26
  • 37
  • Thanks! I also got this error in VS 2013 some time after installing Update 5. – Jeremy Cook Aug 13 '15 at 16:21
  • 4
    Solved it for me with VS2015 Prof. RTM – MarcelDevG Sep 04 '15 at 16:04
  • I renamed the 14.0 folder, and vs2015 created a new one and it seamed to be solved too. – user613326 Sep 08 '15 at 13:23
  • This worked for VS2015 for me. None of the other answers seemed to work. – Michael Labbé Dec 31 '15 at 17:33
  • 3
    Confirmed working in Visual Studio 2015. Definitely deserves an upvote. – Jhourlad Estrella Mar 01 '16 at 14:45
  • 3
    This answer also solved an error I was getting, "The 'XamarinIOSPackage' package did not load correctly". Thanks! – Dan Rigby May 12 '16 at 16:25
  • This didn't fix my issue (I had no 12.0 folder though I did have a 10.0). However the `newVersion="1.1.37.0"` answer below did fix it. – Nick.Mc May 30 '16 at 02:50
  • You did not state the version of VS you have installed @Nick.McDermaid – Shittu Joseph Olugbenga May 30 '16 at 03:18
  • I already had installed: _Visual Studio 2010 SSDT_, and _Visual Studio Express 2015 for Web_. Then I downloaded the ISO install for _SSDT 2015 Update 1_ from here https://msdn.microsoft.com/en-us/mt186501.aspx. Thanks for posting your answer here - I really just wanted to add to the body of knowledge rather than take anything away from your most helpful answer. – Nick.Mc May 30 '16 at 03:38
  • 1
    For the 'XamariniOSPackage' issue, there is a Xamarin bug report about this. I referred to this answer in the bug report for a workaround. https://bugzilla.xamarin.com/show_bug.cgi?id=40781 – jgoldberger - MSFT Jun 02 '16 at 21:47
  • 4
    This also worked after updating Visual Studio 2015 to Update 3, broke my Extension Manager but this sorted it out, thanks! – Chris Pacey Jun 28 '16 at 17:00
  • Worked for me on VS 2015. There was only one file in that folder, but I deleted it and the started VS with no errors. Thank you. – David.Warwick Jul 16 '16 at 22:03
  • I have to do this every time Windows 10 updates itself. – Fergal Moran Jul 19 '16 at 09:23
  • Installed VS2015.3 and started an uninstall, which I ended up cancelling. Was getting the error above and this fixed it for me. Thanks! – TheyCallMeSam Jul 22 '16 at 14:30
  • 3
    This worked after I did a reinstall. Just renamed the directory to be safe instead of a delete – lloyd Nov 23 '16 at 07:53
  • This is so common a problem that Mads has given us a component to clear the component model cache: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ClearMEFComponentCache – John Pankowicz Dec 08 '16 at 23:06
  • 1
    I crashed VS2015 from viruses. After reinstall, the above problem was encountered. This solution worked after I wasted many hours. It should be included in the installation notes. – Alan Wayne Feb 23 '17 at 03:37
  • 1
    Thank you. Your solution of deleting the entire folder (C:\Users\%username%\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache for VS2015) worked for me – Naresh Mittal Sep 14 '17 at 04:48
  • This still works for the newest version of AtmelStudio. Thank you! – Grant Oberhauser Jan 17 '19 at 16:10
49

One more workaround for Visual Studio 2015 Update 1

  1. Open c:\Users\{User_Name}\AppData\Local\Microsoft\VisualStudio\14.0\devenv.exe.config
  2. Change binding redirection for System.Collections.Immutable, newVersion should be 1.1.37.0 (not 1.1.36.0).

The redirection should look like this:

    <dependentAssembly>
        <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
        <bindingRedirect oldVersion="1.0.27.0-1.1.65535.65535" newVersion="1.1.37.0"/>
    </dependentAssembly>

Error from ActivityLog.xml:

SetSite failed for package [CSharpPackage][Could not load file or assembly 'System.Collections.Immutable, Version=1.1.36.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]:{ at Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService.AbstractPackage`2.Initialize() at Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService.CSharpPackage.Initialize() at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)}

You can read more about how to troubleshoot such issues in my blog post How to restore Visual Studio 2015 after the Update 1.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Sergey Tihon
  • 12,071
  • 4
  • 23
  • 29
  • 1
    Thank you very much, I had this problem after I upgraded to Update 1. Your fix did the trick! – abdoulcool Dec 02 '15 at 08:43
  • I had to remove/rename the folder, startup vs, then close it and do the binding redirect. `C:\Users\AppData\Local\Microsoft\VisualStudio\14.0` – Maslow Dec 02 '15 at 19:13
  • Thank you! Changing newVersion to 1.1.37.0 worked for me too after updating to VS2015.1. – Cory Grimster Dec 03 '15 at 19:27
  • 4
    This worked for Atmel Studio 7.0 as well (based on VS2015 shell). – sdkljhdf hda Dec 17 '15 at 23:02
  • 2
    @lego Just for the reference, the config file that need to correct is `AtmelStudio.exe.config`, which is under `AppData\Local\Atmel\AtmelStudio\7.0` – Sakamoto Poteko Jan 11 '16 at 09:05
  • Thanks! You are right! I made changes on `AtmelStudio.exe.config` file, So instead of `newVersion="1.1.36.0"` I typed `1.1.37.0`. And evrything works fine! – IremadzeArchil19910311 Feb 09 '16 at 12:16
  • Just downloaded SSDT 2015 GA (released same days as SQL Server 2016) and it reversed this. Reapplied again and it seemed to fix it – Nick.Mc Jun 02 '16 at 02:25
  • Today I had the old error back and some other weird behaviour (not showing any project templates) so changed this back to .37. This may have been because I installed the SSMS update (13.0.159) – Nick.Mc Oct 05 '16 at 01:01
29

I've had the same problem with Visual Studio 2015 Community RTC and was able to fix this by deleting everything in:

  1. C:\Users\<your users name>\AppData\Local\Microsoft\VisualStudio\14.0 and
  2. C:\Users\<your users name>\AppData\Roaming\Microsoft\VisualStudio\14.0

So I would recommend trying this as you may be able to avoid uninstalling/reinstalling Visual Studio.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Tom Clelford
  • 691
  • 6
  • 8
19

Due to extensions in Visual Studio 2015, I had to rename: C:\Users\\AppData\Local\Microsoft\VisualStudio\14.0

Once renamed, I opened Visual Studio 2015 and received more of these errors but the 14.0 folder was recreated.

I closed Visual Studio 2015 and copied the folders Extensions and STemplate from the original/renamed folder to the new one.

I reopened Visual Studio 2015 and all is working again.

Update 2015-09-24T0017:

It stopped working again. I tried all options in this post. I found another post and this seems to have worked:

Run:

devenv /clearcache
devenv /updateconfiguration
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Bluurocks
  • 191
  • 1
  • 3
8

Similar to @Tom Clelford's solution, but in addition to deleting everything in:

C:\Users{username}\AppData\Local\Microsoft\VisualStudio\14.0

I had to also delete everything in

C:\Users{username}\AppData\Local\Microsoft\VisualStudio\vshub

I didn't have to touch anything in the Roaming folder, but that might vary from user to user.

matthew_b
  • 739
  • 1
  • 7
  • 18
5

My problem happened after installing Visual Studio 2015 Update 1.

I tried all suggested solutions without luck. The solution which worked for me was a one from Eric Knox (Microsoft team).

This is it:

  1. Download the correct VSUpdate 1 configuration to a folder on your machine from this link: https://download.microsoft.com/download/2/7/6/276D15B2-6851-42AA-8D1F-639CD3FC84BE/devenv-exe-config-update1.xml
  2. Open an administrator command prompt and run these steps (assuming you installed to the default location):

    cd "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE"
    ren devenv.exe.config devenv.exe.config.backup
    copy <local path to file downloaded in step #1> .\devenv.exe.config
    devenv /UpdateConfiguration
    

You can check his full article here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ahmed Mozaly
  • 1,454
  • 2
  • 15
  • 22
2

I also had a problem in Visual Studio 2015 RC.

There was a problem using menu FileNewProject... throwing an exception.

I followed the answer from Shittu Olugbenga, 2015-08-10, by deleting the content of folder: "C:\Users\\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache".

I restarted Visual Studio and it worked. :)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
2

The only thing that worked for me was repairing SQL Server Data Tools (go to Uninstall Programs and select Change/Repair):

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Cos
  • 1,649
  • 1
  • 27
  • 50
  • 1
    This worked for me, too. The AppData folders mentioned in other answers were all empty for me. – Seth May 11 '17 at 14:27
1

In my case for NugetPackage, the problem was possibly due to installing Visual Studio 2013 after installing Visual Studio 2015 (co-existing).

The way I resolved it was to re-install NuGet Package Manager for Visual Studio 2015 (in Tools > Extensions and Updates...)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
nkanani
  • 548
  • 1
  • 6
  • 7
1

When starting Microsoft Visual Studio Enterprise 15 Preview (version 15.0.25123), I had the same error:

<entry>
    <record>27</record>
    <time>2016/05/02 12:26:57.451</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>SetSite failed for package [Image Service Package]Source:
 ..
    <guid>{1491E936-6FFE-474E-8371-30E5920D8FDD}</guid>
    <hr>80131522</hr>
    <errorinfo></errorinfo>
</entry>

I try to change the registry key, but it did not work.

It really never worked. Uninstall the previous version, but try it and it worked!

Uninstall Microsoft Visual Studio Ultimate 2015 Preview, (Version 14.0.23310)

It worked (for me :) )

I ran all of the tips in previous answers as well. I do not know if that's necessary or not.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
1

I had the same problem after upgrading to new ReSharper 2016.2. I fixed the problem by suspending the ReSharper in visual studio (menu ToolsOptionsReSharperSuspend).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Megha
  • 509
  • 5
  • 16