简体   繁体   English

在IIS 7.5中创建虚拟目录

[英]Create Virtual Directories in IIS 7.5

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). 我的asp.net Web应用程序知道如何创建子应用程序(带有web.config文件的ASP.NET应用程序,位于根应用程序的子文件夹中)。

Now, I need to configure each sub-application in the IIS with a Virtual Directory, AND, make this new virtual directory an application in a specified application pool. 现在,我需要为IIS中的每个子应用程序配置一个虚拟目录,然后将这个新的虚拟目录作为指定应用程序池中的应用程序。

Is there any API for IIS7.5 using .NET ? 是否有使用.NET的IIS7.5的任何API?

You could use Microsoft.Web.Administration which comes with IIS >= 7.0 您可以使用IIS> = 7.0附带的Microsoft.Web.Administration

There is a similar question here on SO: creating Virtual directory in IIS 7.0 using c#.net SO上有一个类似的问题: 使用c#.net在IIS 7.0中创建虚拟目录
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. 第一个答案中提供的链接显示了如何使用旧的Metabase API(在7.0之前的IIS版本中使用)以及使用appcmd.exe的另一种方法来创建虚拟目录。 appcmd is the command line version of the Microsoft.Web.Administration API. appcmd是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 在此处可以找到直接使用API​​的示例(IMO的最佳方法): 如何使用Microsoft.Web.Administration

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM