Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

Definitive list of workarounds for Package Load Failure errors in Visual Studio 2005

Definitive list of workarounds for Package Load Failure errors in Visual Studio 2005

  • Comments 63

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 toolThis 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
  • Click on the Start menu, choose Run and type cmd
  • Type rd /s /q %windir%\assembly\NativeImages_v2.0.50727_32 and press enter to remove all VS 2005 native images from the cache.

5.  Remove the version of VS 2005 you have installed, manually clean the system and try installing again

  • Uninstall all of VS 2005 using the uninstall instructions and automated uninstall tool
  • Click on the Start menu, choose Run and type cmd
  • Type cd /d %windir%\assembly
  • Type rd /s /q GAC_32 and then rd /s /q GAC_MSIL
  • 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:

  • 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
  • Run this set of steps to clean up the WinSxS folder
  • Reboot the machine
  • Try to install VS 2005 again

If none of the above steps work for you, please leave a comment on this blog post or contact me and I will try my best to help you further.

<update date="12/19/2005"> Added a new step to remove some registry data related to VS 2005 as part of step 4 above </update>

<update date="1/10/2006"> Added link to information about a package load failure scenario caused by Dotfuscator 3.0 </update>

<update date="1/15/2006"> I have seen a couple of issues caused by orphaned keys under the Express Edition hives and the MSDN hives, so I added those to the list in step 4 above </update>

<update date="11/18/2006"> Added a new first step to try repairing the .NET Framework 2.0 </update>

<update date="4/2/2008"> Added caveat that the steps in this post are typically only useful when a beta of VS 2005 was previously installed on the system. </update>

<update date="4/24/2009"> Fixed broken link to the VS 2005 beta uninstall troubleshooting tool. </update>


  • The VS designer is working for 2 other users once we reinstalled the VS. It is from the SQL Server x64 tool cd. For some reason I am still getting the error message when I start VS. I didnt open any SSIS projects. I have tried resetting VS env. It didnt work. I am only getting the "Unable to add data connection The data connection dialog could not be intialized".  I am planning on copying the toolbox.tbd from another user profile. I need to research about toolbox.tbd.

    Thanks again

  • On step 4 when I type the cmd line I receive an error message "Invalid Switch - c:\Windows\assembly\NativeImages_v2.0.50727_32"

  • Hi Tanya52185 - What is the exact command you typed when you tried step 4 on your system?  Maybe there was a typo in one of the command line switches or you are missing a space between one of the commands or something like that?  If possible, can you post a screenshot of the exact text you typed in the cmd prompt and the error it displays?

  • Hello,

    I have the screenshot how do I post it on here?

    I copied and past the command into Word just to make sure I typed it with the correct spaces and it was right. I would still like to show you the screenshot though. Thank you for responding.

  • Here's an attempt of a screenshot. I hope it's not too blurry. Click the link.

  • Hi Tanya52185 - Thanks for posting the screenshot.  It looks like the command line is not typed exactly the way it is listed in the text of this blog post above.  Your screenshot shows that you only ran this command:

    rd /s /q %windir%\assembly\NativeImages

    You need to run this exact command:

    rd /s /q %windir%\assembly\NativeImages_v2.0.50727_32\Microsoft.VisualStu#

    Can you please try again and see if that gets rid of this error you're seeing?

  • Hello,

    Sorry, I don't know how my eyes skipped the rest of the cmd. Here's a screen shot of both steps 3 and 4 I did. First, I did step 3, opened vb and recieved the package load failure. I then tried step 4 and recieved the same message and on another round I rebooted after each step. Still a package load failure. So now I'll proceed to step 5. If you see something wrong with the screenshot, like something missing please let me know. It seems like it went through. I'm not sure though.

  • Good evening,

    I'm on step 5 bullet 5. Click the link for the screenshot. Does this mean I don't have any files for the assembly? I manually went into my windows/assembly folder and found 21 items for vb including v 7 & 8. I tried to unistall these but it said the system couldn't because it needed them to run other programs. Please take a look at my screenshot for step 5 bullet 5, I'm not sure what to do next since it doesn't seem that any of the Dir have NativeImages_2v* ...am I reading the wrong thing?

  • Hi Tanya52185 - From the screenshot, it looks like you've already removed the NativeImages_v2.0.50727_32 folder and also the GAC_MSIL and GAC_32 folders.  You should be able to proceed with a re-install of VS 2005 from here and hopefully this will help.

    Please note also that the steps listed in this blog post are typically only useful in solving package load failures on systems that previously had a beta version of VS 2005 installed on it.  If you haven't ever had a beta of VS 2005 on this system, then it is not likely that these steps will help, and you will need to attempt some other troubleshooting steps.

    What I typically suggest is to try to run devenv.exe with logging enabled to narrow down the cause of the package load failure.  You can do that by running a command like the following:

    C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe /log %temp%\devenv_log.txt

    Then you can look for the string "error" or "warning" in the file %temp%\devenv_log.txt to try to see the exact cause of the package load failure.

    It can also help to post questions about this type of issue on the MSDN Forums at http://forums.microsoft.com.

    Hopefully, one of these suggestions will help.

  • Is there any update for VS 2008?

  • Hi M_a_madero - This blog post is specific to Visual Studio 2005, and in particular it describes workarounds for package load failures caused by previous beta versions of VS 2005 that were orphaned on the system.

    This type of beta scenario did not cause widespread problems in VS 2008 like it did in VS 2005 because of changes made to the beta uninstall logic.

    If you are running into package load failures in VS 2008 (or in VS 2005 on a system that didn't previously have a beta of VS 2005 installed on it), then the thing I typically suggest trying first is to run devenv.exe with a verbose logging command line and then looking at the output to see if you can narrow down the cause of the package load failure.  To do that, you can run the following:

    "%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE\devenv.exe" /log %temp%\devenv2005.log


    "%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" /log %temp%\devenv2008.log

    Then go to your %temp% folder and look at the devenv2005.log or devenv2008.log and search for errors or warnings.

  • I get this error:




       <time>2008/04/24 16:18:52.200</time>


       <source>Microsoft Visual Studio</source>

       <description>End package load [Visual Studio Explorers and Designers Package]</description>



       <errorinfo>Method not found: 'EnvDTE.SolutionEvents EnvDTE.Events.get_SolutionEvents()'.</errorinfo>



  • Hi Justinc - The HR value listed in this log file is a .NET Framework CLR error code that means "An attempt was made to dynamically invoke a method that does not exist."  Normally, this means that there is a mismatch somewhere with the .NET Framework bits on your computer.  I'd suggest trying to repair the .NET Framework 3.5 and see if that makes any difference here.

    Also, it would be helpful to know what OS you are running.  Windows Vista includes the .NET Framework 2.0 and 3.0 as OS components, and they have to be updated in a different way than other OS's, and I've heard of some specific issues on Vista related to this type of error.  If you are running Vista, you may want to try to install Windows Vista SP1 to see if that helps as well (because Vista SP1 contains the .NET Framework 2.0 SP1 and 3.0 SP1, which are required for the .NET Framework 3.5 to function correctly).

  • Uninstalling StyleCop helped me

  • I know this is an old post, but THANK YOU! Just downloaded the TTool.exe and it completely removed VSWD Express 2005 from my machine (after a restart because of a failed previous uninstall). Thanks for saving me from pulling my hair out.

Page 4 of 5 (63 items) 12345
Leave a Comment
  • Please add 3 and 2 and type the answer here:
  • Post