使用IIS7在同一IP地址上托管多个Web应用程序(asp.net)时出错 [英] Error in hosting Multiple web application (asp.net) on same ip address with IIS7

查看:63
本文介绍了使用IIS7在同一IP地址上托管多个Web应用程序(asp.net)时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个Web应用程序,从那个应用程序中,我作为主网站托管在服务器上端口80上的特定ip地址上,我想在相同的IP地址和端口上托管另一个应用程序.

主应用程序运行良好,但是第二个应用程序引发有关web.config的以下错误,

错误代码:0x800700b7

错误:

无法添加将唯一键属性名称"设置为"CrystalImageHandler.aspx_GET"

I am having 2 web application, from that one apllication i hosted as main website on a particular ip address with port 80 on server and i want to host another application on same ip address and port.

Main application is running well but 2nd application throwing following error regarding web.config,

Error Code : 0x800700b7

Error :

Can not add duplicate collection entry of type ''add'' with unique key attribute ''name'' set to ''CrystalImageHandler.aspx_GET''

推荐答案

1. )使用两个单独的网站-
设置端口绑定的主机名,以便IIS可以通过分析请求URL来确定请求哪个网站(右键单击web-SITE并选择编辑绑定"
例如:
web-SITE1:绑定到主机名app1.example.com,端口:80
web-SITE2:绑定到主机名app2.example.com,端口:80

IIS然后将为您选择正确的网站.然后,您将无法仅使用IP地址访问Web-SITES,因为IIS需要HOSTHEADER(= IIS绑定中的主机名)来确定正确的Web-SITE.
2.)或者,您可以在一个网站下运行多个Web应用程序,只需右键单击该网站并选择添加应用程序" ...
例如:
网站:绑定到主机名app.example.com,端口:80
-别名为"app1"的web-Application1
-别名为"app2"的web-application2

客户端可以使用网址app.example.com/app1等访问app1.


不知道哪个更适合您的需求...


当您面对案例2)时,我假设您在web-SITE级别具有一个web.config,而在应用程序级别具有一个web.config.检查其中是否有具有相同名称的添加元素.
1.) using two seperated web-SITES:
set host name for port-bindings, so that IIS can determine which web-site is requested by analyzing the request URL (rightclick web-SITE and choose "edit bindings"
e.g.:
web-SITE1: binds to hostname app1.example.com, port:80
web-SITE2: binds to hostname app2.example.com, port:80

IIS will then chose the right web-SITE for you. You will then be unable to access your web-SITES using only the IP-Address, as IIS needs the HOSTHEADER (=host name in IIS bindings) to determine the right web-SITE.

2.) alternatively, you can run multiple web-APPLICATIONS under one web-SITE, just right-click on the web-SITE and choose "add Application"...
e.g.:
web-site: binds to hostname app.example.com, port:80
- web-Application1 with alias "app1"
- web-application2 with alias "app2"

Clients can access app1 using Url app.example.com/app1, etc.


don''t know which one fits better to your needs...


as you are facing case 2.), i asume that you have a web.config at web-SITE level and one on application-level. check, if there are add-Elements with the same name in it.


这篇关于使用IIS7在同一IP地址上托管多个Web应用程序(asp.net)时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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