问题
I created a new asp.net-mvc project and during setup I chose to use Windows Authentication.
Now I like to turn it off(at least for a while).
I changed the web.config to this
<authentication mode="None" />
But that does change anything. It will still prompt me. I am using the IIS Express.
UPDATE: I mean it still prompts me when using Firefox. Internet Explorer will continue and not show my domain username
回答1:
The web config should overwrite the IIS express config but in this case it seems it does not. What you can try to do is to turn it off on the IIS level as well.
You can go to this directory \IISExpress\config\applicationhost.config open up this file and set the <windowsAuthentication enabled="false" />
.
回答2:
1.) Close VS
2.) Remove the .vs/config
or the .vs
folder next to your solution. The IIS Express regenerates the config/applicationhost.config
file. Changing this file does NOT help - it is regenerated
3.) Edit the <project>.csproj.user
file. There change the lines
<IISExpressAnonymousAuthentication>disabled</IISExpressAnonymousAuthentication>
<IISExpressWindowsAuthentication>enabled</IISExpressWindowsAuthentication>
to
<IISExpressAnonymousAuthentication>enabled</IISExpressAnonymousAuthentication>
<IISExpressWindowsAuthentication>disabled</IISExpressWindowsAuthentication>
4.) Edit and change the web.config Change
<authentication mode="Windows" />
to
<authentication mode="None" />
or comment the whole authentication XML element.
来源:https://stackoverflow.com/questions/26910724/turn-off-disable-windows-authentication-for-asp-net-mvc