I just got the following exception in the Package Designer on my fairly clean Sitecore 6.1 install.
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Exception Details: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[ReflectionTypeLoadException: Unable to load one or more of the requested types.
Retrieve the LoaderExceptions property for more information.]
System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark) +0
[TypeInitializationException: The type initializer for
'Sitecore.Shell.Applications.Installer.Commands.Commands' threw an exception.]
Based on the findings from our support portal, I found out that quite a few customers had the same issue and that is it also popping up in Installation Wizard.
So I decided to publish a quick post about it.
The stack trace indicates that the Installer app is trying to load some commands via reflection and obviously fails during this process.
By merging the bin directory of my Sitecore installation with the clean distributive, I found out that a few assemblies were somehow different, specifically Sitecore.Kernel.dll and Interop.Shell32.dll. So I copied them over from the clean distributive…and that resolved the issue!
It begs the question how it happened specifically, and my hunch is that somehow the DLLs got overwritten during the build process by Visual Studio, but let’s keep that as mystery.