locked
MMC can't load snap-in (BadImageFormatException) RRS feed

  • Question

  • When I try to add my snap-in to MMC, I get an error that MMC can't initialize it due to an InvalidImageFormatException.  I'm running 64-bit Windows 7 Enterprise.  So far my snap-in is just a copy of the "Hello, World!" C# example.  I used the 64-bit version of InstallUtil (from Framework64\v4.0.30319).  My version of MMC is 6.1 (build 7600).  At some point I saw a message that this error was due to the snap-in using a later version of something than MMC was using, but I can't see how to determine which component the error is referring to.  Does anyone have any suggestions how I can track this down?  I'm new to Windows system programming, so I'm not even sure what my options are.

    Thanks!

    -- Tracy Nelson

    Thursday, November 18, 2010 3:56 PM

Answers

  • OK, I seem to have figured something out.  If I change my project's profile from .NET 4.0 to .NET 2.0 and use the corresponding version of InstallUtil, then my snap-in loads.  Might be nice if VS gave some kind of warning about referencing assemblies that target a different version of the runtime than the project is configured to build...
    • Marked as answer by Tracy Nelson Thursday, November 18, 2010 8:48 PM
    Thursday, November 18, 2010 8:09 PM