Microsoft Developer Network > 포럼 홈 > Visual Studio Extensibility > How to Create an Instance of the C# Expression Evaluator
질문하기질문하기
 

답변됨How to Create an Instance of the C# Expression Evaluator

  • 2009년 6월 25일 목요일 오전 8:58Coder2009 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    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.

답변

  • 2009년 7월 1일 수요일 오후 5:01Ed DoreMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

    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

모든 응답

  • 2009년 7월 1일 수요일 오전 9:15Rong-Chun ZhangMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    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!
  • 2009년 7월 1일 수요일 오후 5:01Ed DoreMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

    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