You might start with WMI to find the name of the .dll or .exe you want from the component Id, using System.Management, I made a managed class wrapper around Win32_ClassicCOMClassSetting and did this:
ROOT.CIMV2.
ClassicCOMClassSetting.ClassicCOMClassSettingCollection comClasses = ROOT.CIMV2.ClassicCOMClassSetting.GetInstances("ComponentId
= \"{0D81DFEC-5610-4A2B-9B57-FC33D21366F0}\"");
foreach (ROOT.CIMV2.ClassicCOMClassSetting comClass
in comClasses)
{
Console.WriteLine("AppId= " + comClass.AppID +
"\nComponentId= " + comClass.ComponentId +
"\nInProcServer= " + comClass.InprocServer +
"\nInProcServer32=" + comClass.InprocServer32 +
"\nLocalServer=" + comClass.LocalServer +
"\nLocalServer32=" + comClass.LocalServer32);
Console.ReadKey();
}
Which gives me:
AppId= {0D81DFEC-5610-4A2B-9B57-FC33D21366F0}
ComponentId= {0D81DFEC-5610-4A2B-9B57-FC33D21366F0}
InProcServer=
InProcServer32=
LocalServer=
LocalServer32=J:\PROGRA~1\MSNMES~1\msnmsgr.exe
Which then can be used to find the process id and kill it.
To create the managed class wrapper, if you haven't before, you just navigate in the Server Explorer in Visual Studio, to Servers/Management Classes, right-click, Properties, Add Classes, look under Root/CIMV2 and find and add ClassicCOMClassSetting, then when
it's added, right-click on Classic COM Class Settings and select Generate Managed Class, which creates the wrapper for you.
Warning: Expanding the Classic COM Class Settings node will take all day to enumerate all the components; it's best to avoid it, and go through DCOM Application Settings or something else that has Classic COM Class Settings as a child for whatever DCOM apps
derive from it.
One more thing ... note that you may have to drill down through multiple components to find the server hosting your component.
HTH
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.