none
Creating IMetaDataDispenserEx fails on .NET framework 4 RRS feed

  • Question

  • Hello

    I use the interface IMetaDataDispenserEx to inspect .NET assemblies.
    I get this interface using CoCreateInstance(CLSID_CorMetaDataDispenser,NULL,CLSCTX_INPROC_SERVER,IID_IMetaDataDispenserEx,(void**)&pDisp);

    On a new Windows 10 machine (with .NET framework 4 installed), this call fails.

    The only solution I found is to install .NET framework 3.5.

    Is it normal ?
    Do I miss some SDK which will add this functionnality to .NET framework 4 ?


    Thursday, April 12, 2018 9:05 AM

All replies

  • Hi,

    This forum is discussing the installation of .net framework, I will move your thread to c# forum, thank you for the understanding.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 13, 2018 6:34 AM
  • Hi Yanou,

    Thank you for posting here.

    When the call fails with .net framework 4 installed, what is the error message?

    IMetaDataDispenserEx interface is used as a resource in MsCorEE.dll. The MsCorEE decides what version of the CLR to load based on the assemblies manifest. What is the CLR version of your project? Please check using Environment.Version Property.

    https://msdn.microsoft.com/en-us/library/system.environment.version.aspx

    If you use CLR 2.0, it do not support .net framework 4.

    You could refer to the MSDN document about the .net framework version for CLR version.

    https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 13, 2018 7:20 AM
    Moderator