Night Walker
Night Walker

Reputation: 21260

getting webservice's ApplicationPool

I have some web service running on my computer how can I get by webservice name it's application pool settings ?

I just need to change programmatic way it's "Enable 32 bit Applications" flag.

I am talking about IIS7.

Upvotes: 0

Views: 453

Answers (2)

Zann Anderson
Zann Anderson

Reputation: 4897

You can use the Microsoft.Web.Administration assembly in order to get all sorts of information about your IIS setup. Here is a link to an article about it. In your case it would look something like this:

ServerManager manager = new ServerManager();
manager.ApplicationPools[
    manager.Sites["yoursite"].Applications["servicePath"].ApplicationPoolName].
    Enable32BitAppOnWin64 = true;

That ought to do it.

Upvotes: 2

Oded
Oded

Reputation: 498904

Take a look at the Microsoft.Web.Administration namespace - the ServerManager class is a good starting point, giving you access to all websites, application pools etc.

Upvotes: 0

Related Questions