使用激活库模式注册 .NET DLL

Register a .NET DLL with Activate Library mode

我有几个 .NET 类 构建到 DLL 文件。 我使用 regsvcs.exe 注册它们,使它们在 COM+ (VBscript) 环境中可用。

所有这些注册的组件都设置为Activation => Server application。这使得这个组件 运行s in dllhost.exe.

因为我 运行 在具有经典 ASP 的 IIS 中,我想 运行 它作为 Library application 因为它快 3 倍。

我在 regsvcs.exe 中没有找到如何在注册时进行设置的选项。那么有人知道如何以编程方式设置它吗?

对于那些寻求此信息的人,因为我自己已经找到了:

  COMAdminCatalog catalog = new COMAdminCatalog();
  COMAdminCatalogCollection applications = catalog.GetCollection("Applications");
  applications.Populate();
  foreach (COMAdminCatalogObject application in applications)
  {
    // list needs to be extended if more components needs registration
    if (application.Name == "your component name")
    {
      //application.set_Value("Authentication", 2);
      //application.set_Value("Identity", userName);
      //application.set_Value("Password", password);
      application.set_Value("Activation", "Inproc");
    }
  }
  applications.SaveChanges();