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.
A few customers have contacted me because they have seen the following package load failure error message after uninstalling VS 2005 beta 1 and upgrading to the VS 2005 July or August Community Tech Preview (CTP):
They have all tried running the VS 2005 beta cleanup tool (located here) but did not have any success. One of the fixes that the VS 2005 cleanup tool makes is to delete some native images, and the directory that it uses to delete the native images from is specific to VS 2005 beta 2. However, I recently figured out that this fix needs to be modified to work correctly for post beta 2 CTP builds. That means the current version of the cleanup tool will fix this package load error if you upgrade from beta 1 to beta 2, but not if you upgrade from beta 1 to a post beta 2 build such as the July or August CTP.
There are a couple of options for how to fix this issue:
1. You can use these manual steps:
- Open a cmd prompt
- Run del %windir%\Assembly\NativeImages_v2.0.XXXXX_32\Microsoft.VisualStu# (where XXXXX is the build number of the .NET Framework 2.0 that you have installed - you can figure that out by looking at the name of the folder at %windir%\Microsoft.NET\Framework\v2.0.XXXXX)
- Run %windir%\Microsoft.NET\Framework\v2.0.XXXXX\ngen.exe update /queue
The above steps will remove an incorrect native image from the native image cache and then re-run NGEN.exe to generate a new set of correct native images.
2. You can download a work-in-progress version of the updated VS 2005 cleanup tool
This new version of the cleanup tool will automatically fix this issue on both VS 2005 beta 2 and post-beta 2 builds. Please note that the cleanup tool is still being enhanced to handle additional known issues and should be used at your own risk. Please provide feedback about this tool at this link (my contact page) and/or at this link (Hong's contact page).
<update date="4/11/2008"> Added a caveat to the top of this post indicating that it is typically only useful on systems that had a previous beta version of Visual Studio 2005 installed. </update>