Visual Studio Developer Center > Visual Studio Forums > Visual Studio Extensibility > How to Create an Instance of the C# Expression Evaluator
Ask a questionAsk a question
 

AnswerHow to Create an Instance of the C# Expression Evaluator

  • Thursday, June 25, 2009 8:58 AMCoder2009 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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.

Answers

  • Wednesday, July 01, 2009 5:01 PMEd DoreMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    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

All Replies

  • Wednesday, July 01, 2009 9:15 AMRong-Chun ZhangMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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!
  • Wednesday, July 01, 2009 5:01 PMEd DoreMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    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