Aaron Stebner's WebLog

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

What to do if I get package load failures in the final release of VS 2005?

What to do if I get package load failures in the final release of VS 2005?

Rate This
  • Comments 47

IMPORTANT UPDATE - I have posted an updated set of steps for working around package load failures.  Please read that blog post instead of this post because it contains additional information not listed here.  I do not want to take this post down because I want to keep the comments so others can read them, but this post is essentially obsolete due to the new blog entry I have posted.

Since the final release of Visual Studio 2005 and the .NET Framework 2.0, I have heard from several customers who have been using beta versions of VS, SQL and .NET 2.0, and have followed the uninstall steps to the best of their ability (including trying the auto-uninstall tool linked at the top of the uninstall instructions page) but are still encountering Package Load Failure error messages in the VS IDE after installing the final release.

If you currently have the final release of any version of VS 2005 installed (including the Express Editions), and you are encountering package load failures, here is what I recommend that you do to resolve these issues:

1.  Try to run the VS 2005 troubleshooting tool

Before trying the next set of steps, please download and run the VS 2005 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.

2.  Try to run the following command line to clear out the native image cache

Click on the Start menu, choose Run and type cmd, then type rd /s /q %windir%\assembly\NativeImages_v2.0.50727_32\Microsoft.VisualStu# and press enter to remove native images from the cache.

3.  Manually search for orphaned files in the GAC

I have found that there are some cases where some additional files are getting orphaned on the machine that my test scenarios haven't caught yet (because we shipped a lot of different beta versions and I don't have the time to test out every uninstall permutation, etc).  If I haven't seen the issue in my testing, it hasn't been added to the troubleshooting tool and therefore that tool won't always be helpful.

In general, the orphaned files that cause package load failures are located in the GAC (which is located at %windir%\assembly on your machine).  So, if you have already run the troubleshooting tool and are still running into package load failures, here are some additional steps that have proven useful in identifying additional orphaned files:

  1. Download the FSnap tool and extract it to c:\fsnap.exe on your machine
  2. Run c:\fsnap.exe /bs c:\windows\assembly\ > c:\file_list.txt
  3. Look at the contents of c:\file_list.txt for any files with version number 2.0.xxxxx.xx or 8.0.xxxxx.xx where the xxxxx.xx is not equal to 50727.42
  4. Remove the files that fit this criteria using gacutil.exe (which is installed to %ProgramFiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin if you have VS 2005 installed and chose to install the .NET Framework SDK tools, or can be installed by installing the .NET Framework 2.0 SDK) or by using DOS commands in a cmd prompt

I have found it useful to import the contents of c:\file_list.txt into Excel and then sort alphabetically by column G (which is the file version column).  That makes it easier to zero in on files that have suspicious version information.

Please note that you will need to change the paths in the steps above if you have your OS installed on a drive other than C.  Also, make sure that you include the trailing \ after the "assembly" folder name or else the FSnap tool will not work correctly. 

4.  Help me make the troubleshooting tool better

If you use FSnap and manually delete files and that resolves the package load failures you are seeing, I would appreciate it if you could let me know which files you removed that fixed the issue (either via the contact form or a comment on this post).  If I see common problems that the tool is not yet able to fix, I can add them to the tool and post an updated version to help everyone else out who might hit the same issue.

Hopefully this will help resolve any lingering package load failure issues that you might be seeing.  If these steps still do not work please contact me and let me know.

<update date="11/18/2005"> Added an additional step to clear out the native image cache based on findings I posted here </update>

<update date="12/16/2005"> Added an updated link to a newer set of steps at the top of this blog post </update>

 

  • I found two directories under C:\windows\assembly

    NativeImages_v2.0.50215_32
    NativeImages_v2.0.40426_32

    What should I do?
  • Hi fd - You will see old native image folders like that if you have had any previous beta version of VS 2005 or the .NET Framework 2.0 installed in the past. Those files will not harm anything if you have already upgraded to VS 2005 RTM. However, if you want to, you can remove any folder named NativeImages_v2.0.xxxxx_xx where the xxxxx is not equal to 50727. You can use the following steps to do so:

    1. Click on the Start menu, choose Run and type cmd

    2. Run cd /d %windir%\assembly

    3. Run rd /s /q NativeImages_v2.0.50426_32

    4. Run rd /s /q NativeImages_v2.0.50215_32
  • Thanks Aaron. But occasionally I got “Smart Device Package” load failure error while your troubleshooting tool does not find any issues.
  • Hi fd - for that kind of error, you will need to follow step 2 in this blog post to gather a list of files and try to locate the orphaned older versioned file(s) and delete them manually. I have seen a few cases where the troubleshooting tool does not remove all problematic files unfortunately.

  • Thanks again Aaron. I ran the FSnap tool and it seems that every folder and file in the two directories I mentioned above has a corresponding row in the output file. Should I use "rd" or "gacutil" to remove them?
  • Hi fd - running FSnap will give you a full list of files in %windir%\assembly on your machine. You need to find files that have file versions 2.0.xxxxx.xx or 8.0.xxxxx.xx where xxxxx is not equal to 50727. There is a column for "file version" in each entry in the FSnap output, so you'll need to locate only the ones with these bad versions. I generally use Excel to open the file, and then sort alphabetically by column G (which corresponds to the "file version" column in the FSnap output). If you are having trouble getting this to work please feel free to email me your FSnap output at aaronste@microsoft.com and I will try to take a look.

  • I was having a problem where when I started a new project and selected the first windows form created (Form1.vb or .cs) I would get an error loading the Windows Forms Designer and windows Forms Designer Hosting packages. When I ran FSnap I noticed all of the Infragistics controls I had loaded for a project two years ago had a version number of 2.0.5001.19

    infragistics.shared.v2.dll
    infragistics.win.ultrawindock.v2.dll
    infragistics.win.ultrawineditors.v2.dll
    infragistics.win.ultrawinexplorerbar.v2.dll
    infragistics.win.ultrawingrid.v2.design.dll
    infragistics.win.ultrawingrid.v2.dll
    infragistics.win.ultrawinlistbar.v2.dll
    infragistics.win.ultrawinmaskededit.v2.dll
    infragistics.win.ultrawinschedule.v2.dll
    infragistics.win.ultrawinstatusbar.v2.dll
    infragistics.win.ultrawintabbedmdi.v2.dll
    infragistics.win.ultrawintabcontrol.v2.dll
    infragistics.win.ultrawintoolbars.v2.dll
    infragistics.win.ultrawintree.v2.dll
    infragistics.win.v2.dll

    When I uninstalled Infragistics Version 2.0 my problem was solved.
  • Hi Aaron. I'd just like to say thanks for all the help you are posting on this matter, I am one of a large number of frustrated people trying to make VS 2005 work :) Anyway, onto my problem:-

    I ran FSnap and it reported quite a few assemblies with version 2.0.50727.26. I'm a bit stuck now as I don't know how to get rid of them with gacutil.

    As an example, I have this one:

    Path: c:\windows\assembly\NativeImages_v2.0.50727_32\Accessibility\f3e77159b2a70c49bbb42ea4b363aeda\
    File: accessibility.ni.dll
    Version: 2.0.50727.26

    So, I figure I need to get rid of Accessibility. So I tried this:

    gacutil /u Accessibility

    But that gives me this:

    Microsoft (R) .NET Global Assembly Cache Utility. Version 2.0.50727.42
    Copyright (c) Microsoft Corporation. All rights reserved.


    Assembly: Accessibility, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
    Unable to uninstall: assembly is required by one or more applications
    Pending references:
    SCHEME: <OPAQUE> ID: <{7A1ADD0C-17F3-47B8-B033-A06E189C835D}> DESCRIPTION : <.NET Framework Redist Setup>
    SCHEME: <OPAQUE> ID: <{7131646D-CD3C-40F4-97B9-CD9E4E6262EF}> DESCRIPTION : <.NET Framework Redist Setup>

    Assembly: Accessibility, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Unable to uninstall: assembly is required by one or more applications
    Pending references:
    SCHEME: <WINDOWS_INSTALLER> ID: <MSI> DESCRIPTION : <Windows Installer>
    Number of assemblies uninstalled = 0
    Number of failures = 0


    Somewhere in that I noticed its trying to get rid of version 50727.42. Can you help?
  • Update:

    I managaed to get rid of these by manually deleting them from the windows\assembly folder in DOS, but I still get the same problems. Am I doomed to format?

  • I've tried running through the steps shown above and still cannot get VS2005 to run without package load errors. The trouble shooting tool does not find any problems but the fsnap tool does list several items in the GAC with version numbers other than 50727.

    The problem is when I use gacutil to try and remove them it happily informs me that I cannot remove the items as they are in use by the Windows Installer.

    I did not run any of the betas of VS2005 on this system, but I did run a beta of the Monad Shell so it would appear this is the cause of the problems in my instance.

    Any help in getting VS2005 to run would be appreciated as I would rather avoid having to format and reinstall my system just to get the IDE to run.

    Thanks.
  • Hey all - I have investigated some of these package load failures further and found another possible fix. I added it to this post as a new step #2 and moved the remaining steps down in the list. Please try that step if you haven't already and hopefully it will help you resolve some of these issues.

    Hope this helps!
  • Aaron,

    trying step 2 I get a whole heap of access denied
    even when runas administrator, I also tried running cacls to grant full permission to the directory, but that did not help.

    In my case my error is:
    visual studio explorers and designers package failed to load

    I've got a small number of files versioned 8.0.50215.44 after listing them with fsnap under %windir%\assembly\GAC_MSIL\

    not all are "Microsoft.*", and of the Microsoft ones one is VisualC rather than VisualStudio prefixed, are these all still correct to remove?

    Any other suggestions?

    Thanks

    Kevin
  • I have repeatedly tried to download and install the Express versions. Framework 2.o installs fine, but whatever I do (run fsnap.exe and remove (rd) the folders from C:\windows\assembly that seem to be related to versions 2.0.xxxxx.xx or 8.0.xxxxx.xx, I keep getting the error

    Error 1935. An error occurred during the installation of assembly 'Microsoft.VisualStudio.Editors,Versio="8.0.0.0",ProcessorArchitecture="MSIL",FileVersion="8.0.50727.42",...etc...HRESULT:0x80070003

    I did install Whidbey (never again, promised!) some time. But as I said, fsnap.exe does not show any trace of 2.0.xxxxx.xx or 8.0.xxxxx.xx (only 7.0.4054.0, 7.0.9466.0, 7.0.9951.0, 7.10.3052.4 and 7.10.6001.4)
  • I am sorry. I tried again doing exactly what you wrote and this time it worked. Maybe it was the Microsoft.VisualStudio.Editors file in C:\windows\assembly\gac_msil.

    Anyhow, thank you for this blog.
  • Hi Kevin (hxpro) - the troubleshooting tool listed in step 1 above should remove the v8.0.50215.44 versions of the files that you mention. I am not sure why you would be hitting those access denied errors though - possibly you still have Visual Studio or SQL Server running and have files in use? You may want to try to reboot and then run that command in step 2 again.

    Hope this helps. If not, please contact me using http://blogs.msdn.com/astebner/contact.aspx and I can try to help further...
Page 1 of 4 (47 items) 1234
Leave a Comment
  • Please add 6 and 2 and type the answer here:
  • Post