开发者

getting webservice's ApplicationPool

开发者 https://www.devze.com 2023-02-19 18:32 出处:网络
I have some web开发者_StackOverflow中文版 service running on my computer how can I get by webservice name it\'s application pool settings ?

I have some web开发者_StackOverflow中文版 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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号