以编程方式为 IIS7 站点设置 ASP.NET 网站绑定? [英] Programatically set an ASP.NET website bindings for an IIS7 site?

查看:27
本文介绍了以编程方式为 IIS7 站点设置 ASP.NET 网站绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的 ASP.NET 网站,我最终在 IIS7 服务器上发布/运行.

i've got a simple ASP.NET website that i end up publishing/running on an IIS7 server.

是否可以在我的 web.config 文件中添加一些绑定"信息,而不必通过 IIS7 中的站点手动设置.

Is it possible to to add into my web.config file some 'binding' information, instead of having to set it manually through the site in IIS7.

例如.想象一下我有以下绑定

eg. imagine i have the following bindings

  1. http://foo.mysite.com 80
  2. http://bar.mysite.com 80
  3. http://www.mysite.com 80
  1. http://foo.mysite.com 80
  2. http://bar.mysite.com 80
  3. http://www.mysite.com 80

干杯!

推荐答案

在 IIS 论坛上回答 这里 :-

Answered on the IIS forums here :-

虽然绑定配置是在个别网站上更新级别,绑定配置信息存储在服务器的applicationHost.config 文件,不在下的各个 web.config 文件每个网站.允许个人网站所有者更改绑定因为他们的网站是一种安全风险.

Although binding configuration is updated at an individual web-site level, the binding configuration information is stored in the server's applicationHost.config file, not in the individual web.config files under each web site. Allowing individual web-site owners to change the bindings for their web sites is a security risk.

这篇关于以编程方式为 IIS7 站点设置 ASP.NET 网站绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆