none
CreateInstance fails with .Net 4.0 only RRS feed

  • Question

  • We have a C# assembly with support for unmanaged COM clients. The assembly works fine with .Net 2.0, 3.0, and 3.5, but if only 4.0 is installed, the clients are unable to create instances of the interface exported by the assembly: Calls to CreateInstance fail, returning 0x80040154, "Class not registered".

    We know that the class IS registered because if we then install .Net 3.5 (and do nothing else), it works.

    We have not found a solution or explanation for this.  Anyone?

    TIA

    Monday, August 22, 2011 11:21 AM

Answers

  • Hi,

    .NET 4.0 is differnet from previous versions .NET framework.

    .NET 4.0          CLR 4.0

    .NET 2.0-3.5    CLR 2.0

    You need to ensure which version of .NET Framework the assembly built with, then install the correct version on the target machine.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Paul Zhou Tuesday, August 30, 2011 10:01 AM
    Wednesday, August 24, 2011 8:17 AM

All replies