简体   繁体   English

C#ASP.NET MVC web.config和MachineToApplication错误

[英]C# ASP.NET MVC web.config and MachineToApplication error

I have two projects that is on iis like this: 我有两个关于iis的项目是这样的:

inetpub/wwwroot/mysites/secure/web_application_1 --> has its own web.config

inetpub/wwwroot/mysites/secure/web_application_2 --> has its own web.config

The two applications are totally different applications, however, they both have their own client authentications & custom role & custom membership. 这两个应用程序是完全不同的应用程序,但是,它们都有自己的客户端身份验证和自定义角色和自定义成员身份。

web_application_1 works fine as its the old application. web_application_1作为旧应用程序正常工作。

web_application_2 is the new application, when I ran it on the web, I got errors: web_application_2是新的应用程序,当我在网上运行它时,我遇到了错误:

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. 在应用程序级别之外使用注册为allowDefinition ='MachineToApplication'的部分是错误的。

I am not sure what is wrong in the web.config ? 我不确定web.config什么问题?

The web.config is same with the exception that: web.config与以下例外相同:

  • connection strings is different as they both uses different db 连接字符串是不同的,因为它们都使用不同的db
  • custom membership & custom role is different as they both uses the namespace of the project 自定义成员资格和自定义角色是不同的,因为它们都使用项目的命名空间

The whole IIS & URL was set up for web_application_1; 为web_application_1设置了整个IIS和URL; and since it takes like forever to request new setup from my sysadmin, we both suggested i could just do this: 因为从我的系统管理员请求新设置就像永远一样,我们都建议我可以这样做:

https://www.mywebsite.com/secure/web_application_1

inetpub/wwwroot/mysites/secure/web_application_1 --> has its own web.config
https://www.mywebsite.com/secure/web_application_2

inetpub/wwwroot/mysites/secure/web_application_2 --> has its own web.config

ok found my own solution: 确定找到了自己的解决方案

Add the folder “web_application_2” as an application in IIS manager: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b5488995-fa99-460f-96d7-29d1ddcf3fac.mspx?mfr=true 在IIS管理器中将文件夹“web_application_2”添加为应用程序: http//www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b5488995-fa99-460f-96d7-29d1ddcf3fac.mspx ?mfr=true

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

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