How to Create an Instance of the C# Expression EvaluatorI tried<br/><br/><span style="font-size:x-small"><font size=2> <p> </p> </font></span> <p><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">Guid</span></span><span style="font-size:x-small"> CSharpEEGuid = </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">new</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">Guid</span></span><span style="font-size:x-small">(</span><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&quot;{60F5556F-7EBC-4992-8E83-E9B49187FDE3}&quot;</span></span><span style="font-size:x-small">);<font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">Type</span></span><span style="font-size:x-small"> CSharpEE = </span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">Type</span></span><span style="font-size:x-small">.GetTypeFromCLSID(CSharpEEGuid);<font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">object</span></span><span style="font-size:x-small"> temp = </span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">Activator</span></span><span style="font-size:x-small">.CreateInstance(CSharpEE);<font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">var</span></span><span style="font-size:x-small"> temp2 = temp </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">as</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">IDebugExpressionEvaluator2</span></span><span style="font-size:x-small">;<br/><br/>But the GUID does not seem to be a registered COM GUID in the registry.<br/></span></p>© 2009 Microsoft Corporation. All rights reserved.Thu, 02 Jul 2009 10:58:42 Z407d4094-d57d-4921-87e5-df203fcb9ab3http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/407d4094-d57d-4921-87e5-df203fcb9ab3#407d4094-d57d-4921-87e5-df203fcb9ab3http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/407d4094-d57d-4921-87e5-df203fcb9ab3#407d4094-d57d-4921-87e5-df203fcb9ab3Coder2009http://social.msdn.microsoft.com/Profile/en-US/?user=Coder2009How to Create an Instance of the C# Expression EvaluatorI tried<br/><br/><span style="font-size:x-small"><font size=2> <p> </p> </font></span> <p><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">Guid</span></span><span style="font-size:x-small"> CSharpEEGuid = </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">new</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">Guid</span></span><span style="font-size:x-small">(</span><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&quot;{60F5556F-7EBC-4992-8E83-E9B49187FDE3}&quot;</span></span><span style="font-size:x-small">);<font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">Type</span></span><span style="font-size:x-small"> CSharpEE = </span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">Type</span></span><span style="font-size:x-small">.GetTypeFromCLSID(CSharpEEGuid);<font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">object</span></span><span style="font-size:x-small"> temp = </span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">Activator</span></span><span style="font-size:x-small">.CreateInstance(CSharpEE);<font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">var</span></span><span style="font-size:x-small"> temp2 = temp </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">as</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#2b91af"><span style="font-size:x-small;color:#2b91af">IDebugExpressionEvaluator2</span></span><span style="font-size:x-small">;<br/><br/>But the GUID does not seem to be a registered COM GUID in the registry.<br/></span></p>Thu, 25 Jun 2009 08:58:43 Z2009-06-25T08:58:43Zhttp://social.msdn.microsoft.com/Forums/en-US/vsx/thread/407d4094-d57d-4921-87e5-df203fcb9ab3#45d646fd-5f64-4b57-b104-16b19fbc990bhttp://social.msdn.microsoft.com/Forums/en-US/vsx/thread/407d4094-d57d-4921-87e5-df203fcb9ab3#45d646fd-5f64-4b57-b104-16b19fbc990bRong-Chun Zhanghttp://social.msdn.microsoft.com/Profile/en-US/?user=Rong-Chun%20ZhangHow to Create an Instance of the C# Expression EvaluatorHello, <br/><br/>It seems that the debugger Expression Evaluator is not registered as COM visible. Why you want to create such an instance?<br/><br/>You might have a look at the EESample in Visual Studio SDK.<br/><a href="http://code.msdn.microsoft.com/DebuggerExpEvalDD">http://code.msdn.microsoft.com/DebuggerExpEvalDD</a><br/><br/>Thanks,<br/>Rong-Chun Zhang<hr class="sig">Please mark the replies as answers if they help and unmark if they don't.<br/> <a href="http://cfx.codeplex.com/">Welcome to the All-In-One Code Framework</a>, a sample code project owned by the MSDN Forum Support team!Wed, 01 Jul 2009 09:15:51 Z2009-07-01T09:15:51Zhttp://social.msdn.microsoft.com/Forums/en-US/vsx/thread/407d4094-d57d-4921-87e5-df203fcb9ab3#4c4e5c8a-ce1f-4194-aa2a-d222de2da282http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/407d4094-d57d-4921-87e5-df203fcb9ab3#4c4e5c8a-ce1f-4194-aa2a-d222de2da282Ed Dorehttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20DoreHow to Create an Instance of the C# Expression Evaluator<p>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.<br/><br/>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. <br/><br/>Sincerely,</p><hr class="sig">Ed DoreWed, 01 Jul 2009 17:01:43 Z2009-07-01T17:01:43Z