Friday, May 6, 2011

"Base class could not be loaded" error in VS2008 designer

Visual Studio is erroring trying to open a simple class with the error "The designer inspected the following classes in the file: InstallerSupport --- The base class 'Microsoft.ManagementConsole.SnapInInstaller' could not be loaded"

I've got the assembly referenced and the project builds just fine. I also get errors trying to run installutil on my compiled code, which are probably related. I suspect I'm missing something obvious...

From stackoverflow
  • I think your answer is on the msdn forums: http://social.msdn.microsoft.com/Forums/en-US/clr/thread/72e5c51a-9ea7-40b4-a24d-f2f8f713a01e/

    Here is the snip: "Ok, I tested compiling using microsoft.managementconsole.dll (file version: 5.2.3790.2612Z) from C:\WINDOWS\System32. After using VS2005 compiled, VS2005 automatically added a file call MMCFxCommon.dll in the Debug directory.

    And I was able to install the snap-in successfully using !!!!

    So I go back to C:\Program Files\Reference Assemblies\Microsoft\mmc\v3.0 and find a mmcfxcommon.dll (file version 6.0.6001.16651)

    After copying mmcfxcommon.dll to the debug folder, installation works now.

    So in the end, I was missing mmcfxcommon.dll."

    : Nope - microsoft.mangementconsole.dll is already referenced in the project, set to copy locally and in the /debug dir. No joy.
  • Fixed it - I had installed a more recent SDK, and was trying to load the types from microsoft.managementconsole.dd version 6.0.6001.17011 instead of 5.2.3790.3959. Now that I have escaped from DLL Hell, everything is ok.

0 comments:

Post a Comment