After the Silverlight runtime update to 4.0.60531.0, opening a XAML file in design view was crashing visual studio.
There was also a problem in opening the Toolbox, or any designer that loads the toolbox, with Visual Studio crashing when “Loading toolbox content from package ‘Microsoft.VisualStudio.IDE.ToolboxControlsInstaller.ToolboxInstallerPackage’ {2C298B35-07DA-45F1-96A3-BE55D91C8D7A}”
When I found the solution, it appears this probably only affects systems where ‘System.Windows.dll’ has been previously registered in the GAC.
The solution, is to remove System.Windows from your GAC using the following command from the Visual Studio Command Prompt:
gacutil -u System.Windows
It worked. but a compiler error pops stating “Could not load file or assembly ‘System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e’ or one of its dependencies.”
Well done +1
Thanks Craig & Peter!
Dragging version 4.0.60531.0 from the Silverlight installation folder into my GAC has fixed my VS Toolbox.
I wish I’d found this solution yesterday before I whacked all my IDE settings etc.. Oh well, I’m happy not to reinstall my OS as so many others had suggested!
Update:
It would seem version 4.0.60531.0 of system.windows.dll doesn’t crash. Somehow I had version 4.0.50826.0 in the GAC.
While your fix does stop the designer from crashing, I now get an unable to load system.windows in one of my xaml files. I registered the v3 system.windows but unfortunately I’ve used features of v4 (texttrimming)…guess I’ll put up with crash (avoid opening xaml).