Error message 401.2.: Unauthorized: Logon failed due to server configuration. When application deployed

前端 未结 15 1700
南方客
南方客 2020-12-30 01:20

I have an asp.net 4.0 application that works fine running under cassini but when i deploy to IIS i get the above error. It is running under the Default App pool which a numb

相关标签:
15条回答
  • 2020-12-30 01:33

    If it is a windows authentication based app, then enable Windows Authentication for your site in IIS and disable Anonymous Authentication.

    0 讨论(0)
  • 2020-12-30 01:36

    I was also getting this error trying to run an existing ASP.NET WebForms application under IIS Express (but this probably also applies to IIS).

    The application was configured in the applicationhost.config to use the Clr4IntegratedAppPool application pool. Changing the applicationPool attribute to Clr4ClassicAppPool solved the problem for me.

    0 讨论(0)
  • 2020-12-30 01:39

    I resolved 401.1 and 401.2 authentication errors by adding BackConnectionHostNames to the registry using these directions: https://support.microsoft.com/en-us/help/896861/you-receive-error-401-1-when-you-browse-a-web-site-that-uses-integrate (Method 1)

    1. Click Start, click Run, type regedit, and then click OK.
    2. In Registry Editor, locate and then click the following registry key:
    3. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
    4. Right-click MSV1_0, point to New, and then click Multi-String Value.
    5. Type BackConnectionHostNames, and then press ENTER.
    6. Right-click BackConnectionHostNames, and then click Modify.
    7. In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.
    8. Quit Registry Editor, and then restart the IISAdmin service.

    These errors were occurring on a Windows 10 Professional install running version 1803, on a domain that is named differently than the site I was attempting to authenticate to.

    0 讨论(0)
  • 2020-12-30 01:40

    I upgraded a VS2012 project to 2013 and it changed the Project property from Windows Authentication from Enabled to Disabled and I was then getting this error. Simple change solved the problem. Go to solution and click properties to change this.

    If you are using IISExpress, the lines should look something like:

    <IISExpressAnonymousAuthentication>disabled</IISExpressAnonymousAuthentication>
    <IISExpressWindowsAuthentication>enabled</IISExpressWindowsAuthentication>
    
    0 讨论(0)
  • 2020-12-30 01:40

    For me, I had to change settings from the "Properties" panel to fix this issue. Select project and hit F4 (menu: View->Properties Window) and set properties accordingly.

    Visual Studio 2015 - Properties panel screen shot

    Hope this helps!

    0 讨论(0)
  • Try this:

    • Open IIS Manager
    • Click on your web server (i.e. the server itself; not a site) in the connections bar.
    • Select Authentication from the IIS section.
    • Enable protocols as required. Anything disabled here will not be available to sites hosted on this server; anything enabled here will use the individual site's settings.
    • Restart IIS (start, run, cmd (run as admin), iisreset -noforce)
    0 讨论(0)
提交回复
热议问题