我正在尝试在C#中构建一个小应用程序,它应该启动/停止IIS Express工作进程.为此,我想使用MSDN上记录的官方"IIS Express API":http://msdn.microsoft.com/en-us/library/gg418415.aspx
据我所知,API仅(仅)基于COM接口.为了使用这个COM接口,我通过Add Reference - > COM - >"IIS Installed Versions Manager Interface"在VS2010中添加了对COM库的引用:

到目前为止一切都很好,但下一步是什么?有一个IIISExprProcessUtility可用的接口,包括启动/停止IIS进程的两个"方法".我是否必须编写一个实现此接口的类?
public class test : IISVersionManagerLibrary.IIISExprProcessUtility
{
public string ConstructCommandLine(string bstrSite, string bstrApplication, string bstrApplicationPool, string bstrConfigPath)
{
throw new NotImplementedException();
}
public uint GetRunningProcessForSite(string bstrSite, string bstrApplication, string bstrApplicationPool, string bstrConfigPath)
{
throw new NotImplementedException();
}
public void StopProcess(uint dwPid)
{
throw new NotImplementedException();
}
}
Run Code Online (Sandbox Code Playgroud)
如您所见,我不是一名专业开发人员.有人能指出我正确的方向.任何帮助是极大的赞赏.
更新1: 根据建议,我尝试了下面的代码,但遗憾的是它不起作用:
好的,它可以实例化但我看不到如何使用这个对象...


IISVersionManagerLibrary.IIISExpressProcessUtility test3 = (IISVersionManagerLibrary.IIISExpressProcessUtility) Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("5A081F08-E4FA-45CC-A8EA-5C8A7B51727C")));
Exception: Retrieving the …Run Code Online (Sandbox Code Playgroud)