简体   繁体   中英

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
    /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.

Changing the target framework in the web.config of the hosted site from 4.5 to 4.0 fixes the issue, even without compiling.

Following 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)

1) Why are these sites failing when targeting 4.5?

2) How can I control what happens in this instance? 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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