Microsoft Developer Network > Forenhomepage > Visual Studio Extensibility > How to Create an Instance of the C# Expression Evaluator
Stellen Sie eine FrageStellen Sie eine Frage
 

BeantwortetHow to Create an Instance of the C# Expression Evaluator

  • Donnerstag, 25. Juni 2009 08:58Coder2009 TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     
    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.

Antworten

  • Mittwoch, 1. Juli 2009 17:01Ed DoreMSFT, ModeratorTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Beantwortet

    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

Alle Antworten

  • Mittwoch, 1. Juli 2009 09:15Rong-Chun ZhangMSFT, ModeratorTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     
    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!
  • Mittwoch, 1. Juli 2009 17:01Ed DoreMSFT, ModeratorTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Beantwortet

    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