Asp – Authentication dialog when running with Visual Studio web server

asp.netauthenticationcassiniiisvisual-studio

When using Visual Studio's built in web server, every time I make a page request the standard login box pops up and asks for credentials. It doesn't work if I actually put in my credentials, so I just have to hit cancel 5 times so it will go away.

When I run the application through IIS (locally or on test server) it works just fine (no login box comes up).

Anyone know how to fix this or have any idea what might be causing it?

Best Solution

I assume you mean JavaScript alert box-looking login dialog, right? This dialog pops up when you make a request to a portion of website where anonymous access is disabled from IIS. It is different from ASP.NET authentication.

Do you have some portion of web site protected? Or are you making any HTTP request to external sites, like images and etc?

If your page looks ok after hitting cancel multiple times, it must be one of those HTTP request to protected file like images, css, js or whatever.

I'd look in Fiddler or Firebug to see if any request is failed when you hit cancel in that login dialog.

I'd also try clearing cache/authenticated session on the page that runs on IIS to see if it actually shows you that login dialog.