开发者

Wrongly redirecting to /Account/Login?ReturnUrl

开发者 https://www.devze.com 2023-04-11 14:21 出处:网络
I have been working on a classic .Net web forms (4.0 framework) solution for my current project.Since the project is too big to upgrade to MVC, I simply added a MVC project to the solution and created

I have been working on a classic .Net web forms (4.0 framework) solution for my current project. Since the project is too big to upgrade to MVC, I simply added a MVC project to the solution and created all my REST services in the MVC controllers.

It was working fine for several days and randomly I started getting redirected to Accounts.Login?{ReturnUrl}. My web forms app doesn't hav开发者_如何学编程e an Account folder the logical conclusion was that the MVC project was interfering somehow.

After checking all the configs, IIS settings, and debugging from the Global.asax to find out that I had no clue what was redirecting; I started doing a source control compare to see what changed where.

I found the below line had been added to the appSettings tag in my web config. After removing it everything started working correctly.

<add key="webpages:Enabled" value="true" />

After a bit of searching I found this article...

what is the function of webpages:Enabled in MVC 3 web.config

...which explains a little, but not why this setting would cause the site to redirect away from my default document to a URL that doesn't exist in either project or why my MVC project is being called at all.

Can anyone point me in the right direction?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号