开发者

Create Virtual Directories in IIS 7.5

开发者 https://www.devze.com 2023-01-08 13:47 出处:网络
My asp.net web application knows how to create sub-applications (asp.net applications with web.config file, located in sub folders of the root application).

My asp.net web application knows how to create sub-applications (asp.net applications with web.config file, located in sub folders of the root application).

Now, I need to configure each sub-application in the IIS with a Virtual Directory, AND, make this new virtual directory an applica开发者_JAVA技巧tion in a specified application pool.

Is there any API for IIS7.5 using .NET ?


You could use Microsoft.Web.Administration which comes with IIS >= 7.0

There is a similar question here on SO: creating Virtual directory in IIS 7.0 using c#.net
The link provided in the first answer shows how to create virtual directory using the old Metabase API (used in IIS Versions prior to 7.0) and another method that uses appcmd.exe. appcmd is the command line version of the Microsoft.Web.Administration API.

An example that uses the API directly (IMO the best approach), can be found here: How to Use Microsoft.Web.Administration

0

精彩评论

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