MSDN > Home page del forum > Visual Studio Extensibility > How to Create an Instance of the C# Expression Evaluator
Formula una domandaFormula una domanda
 

Con rispostaHow to Create an Instance of the C# Expression Evaluator

  • giovedì 25 giugno 2009 8.58Coder2009 Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    I tried

     

    Guid CSharpEEGuid = new Guid("{60F5556F-7EBC-4992-8E83-E9B49187FDE3}");

     

    Type CSharpEE = Type.GetTypeFromCLSID(CSharpEEGuid);

     

    object temp = Activator.CreateInstance(CSharpEE);

     

    var temp2 = temp as IDebugExpressionEvaluator2;

    But the GUID does not seem to be a registered COM GUID in the registry.

Risposte

  • mercoledì 1 luglio 2009 17.01Ed DoreMSFT, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta

    Expression Evaluators are registered under the VS hive's AD7Metrics registry key. You've correctly identified the CLSID, but as Zhang pointed out it isn't COM creatable. You would need to use something like ILocalRegistryService.CreateInstance to create an instance of the EE.

    Even so, this isn't a supported scenario. The EE is registered so that the VS debug package can create it when needed, and it's tightly intertwined with other services like the C# project system and the debugger's debug engine.

    Sincerely,


    Ed Dore

Tutte le risposte

  • mercoledì 1 luglio 2009 9.15Rong-Chun ZhangMSFT, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Hello,

    It seems that the debugger Expression Evaluator is not registered as COM visible. Why you want to create such an instance?

    You might have a look at the EESample in Visual Studio SDK.
    http://code.msdn.microsoft.com/DebuggerExpEvalDD

    Thanks,
    Rong-Chun Zhang
    Please mark the replies as answers if they help and unmark if they don't.
    Welcome to the All-In-One Code Framework, a sample code project owned by the MSDN Forum Support team!
  • mercoledì 1 luglio 2009 17.01Ed DoreMSFT, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta

    Expression Evaluators are registered under the VS hive's AD7Metrics registry key. You've correctly identified the CLSID, but as Zhang pointed out it isn't COM creatable. You would need to use something like ILocalRegistryService.CreateInstance to create an instance of the EE.

    Even so, this isn't a supported scenario. The EE is registered so that the VS debug package can create it when needed, and it's tightly intertwined with other services like the C# project system and the debugger's debug engine.

    Sincerely,


    Ed Dore