Programatically set an ASP.NET website bindings for an IIS7 site?(以编程方式为 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
- http://foo.mysite.com 80
- http://bar.mysite.com 80
- http://www.mysite.com 80
- http://foo.mysite.com 80
- http://bar.mysite.com 80
- 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 网站绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:以编程方式为 IIS7 站点设置 ASP.NET 网站绑定?
基础教程推荐
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- 将数据集转换为列表 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- 如果条件可以为空 2022-01-01
- 从 C# 控制相机设备 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
