如何创建一个Web安装项目新的应用程序池? [英] How can I create a new application pool in a Web Setup Project?

查看:259
本文介绍了如何创建一个Web安装项目新的应用程序池?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要部署我的web服务。它需要有自己的凭据运行在IIS中的单独的应用程序池。

I need to deploy my web service. It needs to run in a separate application pool in IIS with its own credentials.

是否有可能通过在VS 2008?

Is it possible to do this by using a Web Setup Project in VS 2008?

使用Web安装项目在默认情况下做到这一点,我似乎只能够选择一个现有的应用程序池。

By default, I seem to only be able to choose an existing application pool.

推荐答案

我已经下来之前这条路上,不幸的是,你会需要手动创建应用程序池或编写自定义操作来管理这个给你。

I've been down this road before and unfortunately you'll need to create the application pool manually or write a Custom Action to manage this for you.

继Grzenio在下面的评论的问题:

Further to Grzenio's question in the comments below:

你能不能给我一个提示,其中开始寻找代码/辅助类?那你保持你的项目中的Web安装项目,或者只是使用标准的应用程序的安装项目呢?

我添加了一个名为 InstallHelper 来包含安装项目的解决方案的新项目。在该项目中我创建了一个名为 InstallActions 类派生自:

I added a new project called InstallHelper to the solution containing the setup project. In that project I created a class called InstallActions which derives from:

System.Configuration.Install.Installer (MSDN )

System.Configuration.Install.Installer (MSDN).

有四种方法可以在安装基类重写以允许您指定自定义操作取决于是否你在安装,提交,卸载或回滚阶段的安装程序运行时。

There are four methods you can override on the Installer base class to allow you to specify custom actions depending on whether you're in the Install, Commit, Uninstall or Rollback phases when the installer is running.

我还添加了一些文本框对话来安装项目的用户界面。输入和国家从这些对话中捕获传递给您的自定义通过词典安装操作。 。即:

I also added a number of text box dialogues to the setup project user interface. Input and state captured from these dialogues is passed to your custom install action via a dictionary. i.e.:

using System.Collections.Specialized;
using System.ComponentModel;
using System.Configuration.Install;
using System.Windows.Forms;

namespace InstallHelper
{
  [RunInstaller(true)]
  public partial class PostInstallActions : Installer
  {   
    public override void Install(IDictionary state)
    {
      base.Install(state);
      // Do my custom install actions
    }

    public override void Commit(IDictionary state)
    {
      base.Commit(state);
      // Do my custom commit actions
    }

    public override void Uninstall(IDictionary state)
    {
      base.Uninstall(state);
      // Do my custom uninstall actions
    }
    public override void Rollback(IDictionary state)
    {
      base.Uninstall(state);
      // Do my custom rollback actions
    }
  }
}

要自定义操作项目添加到安装项目中,打开自定义操作器/编辑器,并指定由 InstallHelper 项目输出。

To add your custom action project to the setup project, open the Custom Actions viewer/editor and specify the output from the InstallHelper project.

这是基本知识,并应该让你开始。 Web安装项目还支持自定义操作和额外的用户输入对话框,所以你可能希望重新使用现有的项目中,除了自定义操作。

That's the basics and should get you started. The Web Setup Project also supports custom actions and additional user input dialogue boxes, so you may wish to re-use your existing project, in addition to a custom action.

这篇关于如何创建一个Web安装项目新的应用程序池?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆