Important note - the steps in this blog post have typically only proven useful in cases where a previous beta of Visual Studio 2005 was installed on the system prior to installing the final release of VS 2005. If you have never had a beta of VS 2005 on your system and are encountering package load failure errors, these steps will most likely not help. In that type of scenario, I recommend running devenv.exe with the /log switch (described in this MSDN topic) to create a log file of the packages it tries to load and then search in that log file for errors and warnings to help narrow this issue down further.

Ever since the final version of Visual Studio 2005 was released, I have been hearing from customers who are running into Package Load Failure errors while trying to get beta versions uninstalled and the final version installed. I have previously posted a set of steps that I have found will resolve nearly all cases of these Package Load Failure errors. However, there have been some cases where these steps are not enough and more in-depth manual removal steps have proven necessary. Up until now, I have been resisting posting the additional steps that are necessary in some cases because I really want folks to try out the other steps I have posted first. However, I am going to go ahead and post a complete set of steps and just duplicate my previous steps in an effort to communicate the workarounds I have found as widely as possible while also making my best effort to make things as easy as possible for the majority of customers.

So, without further ado, here is a complete, hopefully definitive set of steps that will help resolve all Package Load Failure errors seen while trying to use the final release of VS 2005 on a system that previously had a beta version installed. Please try these steps in the order listed and check to see if the Package Load Failure errors are resolved after completing each step so that you can try to avoid needing to perform more removal steps than are strictly necessary on your system.

Please note - if you have Dotfuscator 3.0 installed on your system, you should first try the workaround described here to see if you are running into a known issue that has been fixed by Preemptive (the company that produces Dotfuscator).

1. Try to repair the .NET Framework 2.0

Sometimes, package load failures have a very simple cause - the .NET Framework 2.0 is somehow in a broken state. Before trying any of the more complicated steps listed below, it is worth trying to repair the .NET Framework 2.0. To do this, go to the Add/Remove Programs control panel, locate the item named Microsoft .NET Framework 2.0 and choose to repair it.

2. Try to run the VS 2005 beta uninstall troubleshooting tool

Before trying any of the manual steps listed below in this blog post, please download and run the VS 2005 beta uninstall troubleshooting tool. This tool is built on the same code base as the auto-uninstall tool, but it has knowledge of some specific problems that existed in previous beta versions of VS 2005 and knows how to go in and surgically clean them up.

3. Try to run the following command line to clear out parts of the native image cache

Close Visual Studio and/or reboot the system to make sure that there will not be any files in use

Click on the Start menu, choose Run and type cmd

Type rd /s /q %windir%\assembly\NativeImages_v2.0.50727_32\Microsoft.VisualStu# and press enter to remove a subset of the native images that have proven problematic in the past from the cache.

4. Try to run the following command line to clear out all of the native image cache

Close Visual Studio and/or reboot the system to make sure that there will not be any files in use

Type dir and locate any directories named NativeImages_v2.0* and type rd /s /q <directory> to delete all VS 2005 native image directories as well

Using regedit.exe, remove all of the following registry sub-hives, including all registry keys and values underneath them:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\8.0HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDN\8.0HKEY_CURRENT_USER\SOFTWARE\Microsoft\MSDN\8.0HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VBExpress\8.0HKEY_CURRENT_USER\SOFTWARE\Microsoft\VBExpress\8.0HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\8.0HKEY_CURRENT_USER\SOFTWARE\Microsoft\VCExpress\8.0HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCSExpress\8.0HKEY_CURRENT_USER\SOFTWARE\Microsoft\VCSExpress\8.0HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VJSExpress\8.0HKEY_CURRENT_USER\SOFTWARE\Microsoft\VJSExpress\8.0HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VWDExpress\8.0HKEY_CURRENT_USER\SOFTWARE\Microsoft\VWDExpress\8.0HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Hatteras

Run this set of steps to locate and delete any files with versions 2.0.xxxxx.xx and 8.0.xxxxx.xx that are still left on your system. Please note that all of the Package Load Failure errors that I have seen so far have been caused by files left behind in %windir%\assembly (the GAC) on the machine, so pay special attention to any leftover files in this location and make sure that all orphaned files with versions 2.0.xxxxx.xx and 8.0.xxxxx.xx are removed before attempting to reinstall VS 2005

I would also recommend cleaning up obj directories left behind in project directories, I've seen obj dirs from old CTP's left in projects causing issues.

Also there are directories that may be left behind after uninstall in the local settings/app data etc for MSDN and VS. Also the settings paths in My Documents/Visual Studio 2005/. I'd get rid of as much of those too since I've got first hand experience of subtle issues being caused by having those left behind from the uninstalls.

Just wondering if anyone else has complained of the problem that I am seeing with VS2005 Release. When I open a form, the cursor goes crazy and the whole form flickers. You have to click on one of the other tabs to get out of this state and that can take about a minute or so. This even happens with a simple application with just one button on the form and consistently happens most of the time when I switch to design view. My co-worker has also started seeing this on his machine. We both had the beta 2 installed previously and completely uninstalled it before installing the release version. The funny thing is that my other co-worker has no problems on his machine and he has the same configuration as we do.

I have installed Visual Studio 2005 Team Suite trial edition on a new Windows XP machine. There have been no previous versions on this machine, yet I am getting the "Package 'Windows Forms Designer Hosting Package' has failed to load properly" error message. What do you suggest?

Hi Gary - if you have never had any beta versions of VS 2005 installed, you may have some other add-in for Visual Studio installed that could cause this. Can you try to use the instructions in step 1 of my blog post at http://blogs.msdn.com/astebner/archive/2005/07/01/434814.aspx to gather a list of installed applications and then send me that list at aaronste@microsoft.com so I can try to take a look?

John

10 Feb 2006 5:52 PM

After running step 1, I noticed that I had a problem with starting SQL 2005 Management Studio. In particular, it would not show the initial connect dialog, and then the main window would be non-responsive. It would work, however, if you ran SQLWB -S localhost -E.

After running step 2, however, everything is back to normal.

Mark

16 Feb 2006 3:37 AM

I was ready to throw in the towel after installing & re-installing four times and basically blowing a day and a half. Nothing worked until I followed Aaron's instructions. Awesome solution!

SHAME ON MICROSOFT for making this so difficult (especially for novices), but kudo's to Aaron for his help. This works!

Moshe Panzer

28 Feb 2006 12:44 PM

I am sorry, but I really don't understand why I should follow so many steps (that really looks scary for novices) in order to U-N-I-N-S-T-A-L-L one program. We are not taking apart a space suhuttle here!!! (of course I followed the perfect instruction above, thanks Aaron).
You know, the feature that Microsoft invented for this kind of actions is called "Uninstall".
Moshe

Hi Moshe and Mark - I'm very sorry for the long list of steps and the hassles you had to go through. The list of steps is complicated because of some bugs that shipped in earlier beta versions of VS 2005 and the .NET Framework 2.0 that were fixed later on, but that are tricky to workaround after the beta was already installed on the system and uninstalled in a non-optimal order. This type of uninstall scenario is one that we know was very painful and did not work well at all for the VS 2005 beta, and we will be looking at ways to make this seamless in future releases of Visual Studio.

Eckhad

31 Mar 2006 1:37 AM

I may have found another reason (and solution) for the package load failure.
On my System I have VisualC# express und Visual C++ Express 2005. Since I experimented with the Symbol Server settings, I got the dreaded "Package Load Failure" when starting VC#, but also a rather helpful "... project creation failed." when I tried to create a new project.
Turns out I had the following directories (! not files!) in my [ProgramFiles]\Microsoft Visual Studio 8\Common7\IDE folder:
cscdll.dll
cscui.dll
imagehlp.dll
mpr.dll
mscorlib.dll
rsaenh.dll
system.data.dll
system.drawing.dll
system.xml.dll
Deleting this directories made the error go away, but they returned after some days (probably due to some more debugging with Sysmbol server useage).

Hi Eckhad and Seppo - thank you for posting these additional cases that you have seen that can cause package load failures. I will create a new post for each of them in the near future to make it easier for search engines and other users to find....