简体   繁体   English

托管的ASP.net应用程序返回登录页面

[英]Hosted ASP.net application returning to log in page

I have a security layer that allows access to sub sites hosted in an adjacent folder in IIS 7 using a Custom Membership provider. 我有一个安全层,该层允许使用自定义成员资格提供程序访问IIS 7中相邻文件夹中托管的子站点。

IIS
    /Security Layer
    /Hosted Sites
         /Site 1
         /Site 2
         etc...

So a user will authenticate using the Security Layer, and then will have access to hosted sites depending on the permissions provided by the security layer. 因此,用户将使用安全层进行身份验证,然后将根据安全层提供的权限访问托管站点。

I have had issues where I uploaded a site that targets the .Net 4.5 framework in the web.config of that site, and the hosted site would fail to load, and the user would be returned to the login page specified in the security layer web config. 我遇到了一个问题,我在该站点的web.config中上载了一个针对.Net 4.5框架的站点,并且托管站点将无法加载,并且用户将返回到安全层Web中指定的登录页面配置。

Changing the target framework in the web.config of the hosted site from 4.5 to 4.0 fixes the issue, even without compiling. 将托管站点的web.config中的目标框架从4.5更改为4.0,即使不进行编译也可以解决该问题。

Following http://msdn.microsoft.com/en-us/library/hh925568%28v=vs.110%29.aspx 以下http://msdn.microsoft.com/en-us/library/hh925568%28v=vs.110%29.aspx

HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP shows 4.0 installed HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full shows release as 378389 (v4.5) HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Microsoft \\ NET Framework Setup \\ NDP显示已安装4.0 HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Microsoft \\ NET Framework Setup \\ NDP \\ v4 \\ Full显示版本为378389(v4.5)

1) Why are these sites failing when targeting 4.5? 1)为什么在定位4.5时这些网站会失败?

2) How can I control what happens in this instance? 2)如何控制在这种情况下会发生什么? I would like to show an error only for this specific case 我只想针对这种情况显示一个错误

Check your application pool in IIS Manager.I think your Application pool is set up for .NET v4.0, change it to v4.5. 在IIS管理器中检查您的应用程序池。我认为您的应用程序池是针对.NET v4.0设置的,请将其更改为v4.5。

http://technet.microsoft.com/en-us/library/cc731755%28v=ws.10%29.aspx http://technet.microsoft.com/zh-cn/library/cc731755%28v=ws.10%29.aspx

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

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