简体   繁体   English

是否可以在IIS 7.5中运行ASP.NET而无需创建虚拟目录或应用程序?

[英]Is it possible to run ASP.NET in IIS 7.5 without creating Virtual Directories or Applications?

I have a Continuous Integration server with dozens of ASP.NET applications hosted on IIS. 我有一台持续集成服务器,在IIS上托管了数十个ASP.NET应用程序。 Everytime I want to deploy a new application, I have to create a new Website or virtual Directory and configure it as an application in IIS. 每当我要部署新应用程序时,都必须创建一个新的网站或虚拟目录,并将其配置为IIS中的应用程序。

I would really love to have only one website listening in a specific port (say, 80) serving multiple ASP.NET sites according to wildcard host headers. 我真的很希望只有一个网站可以根据通配符主机头在特定端口(例如80)内监听多个ASP.NET网站。

For instance: 例如:

*.dev.mydomain.int -> my server's ip address (eg: 192.168.1.32) * .dev.mydomain.int->我服务器的IP地址(例如:192.168.1.32)

IIS web site reads the host header and try to find a local folder with the same name. IIS网站读取主机标头,然后尝试查找具有相同名称的本地文件夹。 Ex: when a request uses the host header "helloworld.dev.mydomain.int" IIS tries to open a preconfigured folder appending the host header site name (eg: D:\\dev\\helloworld) 例如:当请求使用主机头“ helloworld.dev.mydomain.int”时,IIS将尝试打开一个预先配置的文件夹,并在其中附加主机头站点名称(例如:D:\\ dev \\ helloworld)

IIS serves the contents of the folder as an ASP.NET application, using preset configurations (Application Pool, ASP.NET version, and so on). IIS使用预设配置(应用程序池,ASP.NET版本等)将文件夹的内容作为ASP.NET应用程序提供。

My goal here is not to create a web site or virtual directory for each and every project in our CI server. 我的目标不是在CI服务器中为每个项目创建网站或虚拟目录。 I know I can create them programmatically, but I'd prefer a more dynamic solution. 我知道我可以以编程方式创建它们,但是我更喜欢动态的解决方案。

Thanks in advance 提前致谢

You can use MSBuild tasks to create Virtual Directories / Web sites automatically. 您可以使用MSBuild任务自动创建虚拟目录/网站。

http://fczaja.blogspot.com/2009/02/automatic-deployment-of-webapp-on-iis.html http://fczaja.blogspot.com/2009/02/automatic-deployment-of-webapp-on-iis.html

I had it working on a large application with many branches (we had an environment for each branch) and I didn't have to open IIS settings at all. 我让它在具有多个分支的大型应用程序上工作(每个分支都有一个环境),而我根本不必打开IIS设置。 Just pure hands-off process. 只是纯粹的放手过程。

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

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