ChatGPT解决这个技术问题 Extra ChatGPT

Packages not loading after installing Visual Studio 2015 RTM

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

At Tools --> Extensions and Updates I have tried to de-install and re-install the extensions. But when I click on the menu item "Extensions and Updates" I get the "Object reference not set" exception?? So I can't try this option. I have deinstalled Visual Studio 2015 and reinstalled it. No effect. I have done what is suggested in https://connect.microsoft.com/VisualStudio/feedback/details/1123745/setsite-failed-for-package-microsoft-visualstudio-editor-implementation-editorpackage at 13-2-2015 at 16:49. No effect. In fact, the entire exact same folder structure and files (at a quick glance) gets copied back after starting up Visual Studio 2015 again.

I have deinstalled Visual Studio 2015 and reinstalled it. No effect.

I have done what is suggested in https://connect.microsoft.com/VisualStudio/feedback/details/1123745/setsite-failed-for-package-microsoft-visualstudio-editor-implementation-editorpackage at 13-2-2015 at 16:49. No effect. In fact, the entire exact same folder structure and files (at a quick glance) gets copied back after starting up Visual Studio 2015 again.

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:

https://i.stack.imgur.com/gNCbA.png

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!

Had a similar error. VS would not repair, I ended up doing a complete uninstall of both, and then reinstall. Works now.
Also, be sure to search Program Files, Program Files (x86), and AppData for VS remnants. I still had VS 2012 stuff left over
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: Have you uninstalled EVERYTHING VS2015 RELATED in Programs & Features?
You shouldn't try to answer your question at the end of the question. If you want, add a new answer yourself.

P
Peter Mortensen

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:

Close all instances of Visual Studio Delete everything in this folder C:\Users\%username%\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache 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.


Solved it for me with VS2015 Prof. RTM
Confirmed working in Visual Studio 2015. Definitely deserves an upvote.
This answer also solved an error I was getting, "The 'XamarinIOSPackage' package did not load correctly". Thanks!
This also worked after updating Visual Studio 2015 to Update 3, broke my Extension Manager but this sorted it out, thanks!
This worked after I did a reinstall. Just renamed the directory to be safe instead of a delete
P
Peter Mortensen

One more workaround for Visual Studio 2015 Update 1

Open c:\Users\{User_Name}\AppData\Local\Microsoft\VisualStudio\14.0\devenv.exe.config 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.


Thank you very much, I had this problem after I upgraded to Update 1. Your fix did the trick!
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
Thank you! Changing newVersion to 1.1.37.0 worked for me too after updating to VS2015.1.
This worked for Atmel Studio 7.0 as well (based on VS2015 shell).
@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
P
Peter Mortensen

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

C:\Users\\AppData\Local\Microsoft\VisualStudio\14.0 and C:\Users\\AppData\Roaming\Microsoft\VisualStudio\14.0

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


worked for me too after reinstalling VS2015pro x64 Win8.1
this solution worked for me in windows 10. thanks a lot.
P
Peter Mortensen

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

Running "devenv /clearcache devenv /updateconfiguration" worked for me as well.
This also fixed a "package not loaded correctly" error in Visual Studio 2013 Update 4.
this is the only thing that worked for me. I didn't have Users\username\AppData folder on Windows 10 machine.
m
matthew_b

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.


P
Peter Mortensen

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:

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 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 .\devenv.exe.config devenv /UpdateConfiguration

You can check his full article here


P
Peter Mortensen

I also had a problem in Visual Studio 2015 RC.

There was a problem using menu File → New → Project... 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. :)


P
Peter Mortensen

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

https://i.stack.imgur.com/3cxdo.png


This worked for me, too. The AppData folders mentioned in other answers were all empty for me.
P
Peter Mortensen

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


P
Peter Mortensen

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.


P
Peter Mortensen

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