0

I turned on the feature to 'Break when an exception is Common Language Runtime Exception' using Ctrl+Alt+E in VS2013. Since then I got different errors when trying to run my project (cannot access ASP.NET Temp folder, wrong version of PageInspector, etc.), but I have found the solutions for those.

I still have a problem: 1. in the Project Properties I set Anonymous Authentication to Enabled and Windows Authentication to Disabled. Result: "A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll"

Additional information: Invalid file name for file monitoring ..." 2. in the Project Properties I set Anonymous Authentication to Disabled and Windows Authentication to Enabled. Result: "404 - File or directory not found". The URL looks odd as well:

http://localhost:52016/Account/Login.aspx?ReturnUrl=%2FAccount%2FLogin.aspx%3FReturnUrl%3D%252FAccount%252FLogin.aspx%253FReturnUrl%253D%25252FAccount%25252FLogin.aspx%25253FReturnUrl%25253D%2525252FAccount%2525252FLogin.aspx%2525253FReturnUrl%2525253D%252525252FAccount%252525252FLogin.aspx%252525253 ... "

The URL generated is too long so I cut it off.

What could be the cause for this?

Johan G
  • 1,064
  • 3
  • 16
  • 30
  • Your authentication is broken, it's stuck inside in an infinite redirect loop that keeps encoding the current url which loops and duplicates itself growing at an exponential rate. – Chris Marisic Feb 24 '16 at 20:07

1 Answers1

0

I had the same error when trying to run a .Net Web Form after publishing to the server. First in IIS set:

Anonymous Authentication to Disabled
Windows Authentication to Enabled

This then caused the “odd” (and long) URL and 404 error. To fix that, I had to add the “owin” key to my Web.Config:

<configuration>
   …
  <appSettings>
    <add key="owin:AutomaticAppStartup" value="false"/>
  </appSettings>
</configuration>

That suggestion came from: New Asp.Net MVC5 project produces an infinite loop to login page

Community
  • 1
  • 1
Crazy Cat
  • 1,332
  • 15
  • 19