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

前端 未结 15 1728
南方客
南方客 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:45

    I had a similar issue and resolved it by setting optimizeCollections to false in web.config and immediately reverting the change after verifying that it worked.

      <system.web>
        ..
        <compilation debug="true" targetFramework="4.7.1" optimizeCompilations="false" />
        ..
      </system.web>
    

    Perhaps the same thing could have been achieved by deleting asp.net temp folder..

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

    This always happens to our project after it's reloaded.

    If you're using Windows Authentication, the problem might be as simple as updating your project properties to Enable Windows Authentication.

    In Visual Studio, get to your project properties (I usually right-click a file > properties to open the properties window. Then click on my project). Make sure Windows Authentication is set to Enabled

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

    If you're working with IIS Express, check the web.config

            <!--  AUTHENTICATION 
          This section sets the authentication policies of the application. Possible modes are "Windows", 
          "Forms", "Passport" and "None"
    -->
        <authentication mode="Windows"/>
        <identity impersonate="true"/>
        <!--  AUTHORIZATION 
          This section sets the authorization policies of the application. You can allow or deny access
          to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous 
          (unauthenticated) users.
    -->
        <!--<authorization>
            <deny users="?"/>-->
            <!-- Allow all users -->
            <!--  <allow     users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
                  <deny      users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
            -->
        <!--</authorization>-->
    
    0 讨论(0)
  • 2020-12-30 01:52

    what helped to me is commented out the lines below in the web.config

    <system.web>
        <compilation debug="true" targetFramework="4.5.2" />
        <httpRuntime targetFramework="4.5" />
        <!--  
        <authentication mode="Windows" /> 
        <authorization>
            <deny users="?" />
        </authorization>
        <identity impersonate="false" />
        -->
        <customErrors mode="Off" />
    </system.web>
    
    0 讨论(0)
  • 2020-12-30 01:53

    I had the same problem just now. None of the fixes I found worked, so I'll just post here in case it helps someone.

    For me the issue was solved this way:

    • Open IIS manager
    • Select "Application Pools"
    • Right click on the application pool you are using and select "Advanced settings"
    • Set "Enable 32-Bit Applications" to "True"
    • Click "OK" to close the dialog box
    • Right click on the application pool again and select "Recycle"

    Hope that will help someone else out! This was driving me crazy.

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

    With IIS, this really just sounds like you need to check the authentication settings for your app in IIS Admin. Try this link: http://support.microsoft.com/kb/253667

    This is for IIS6, you didn't mention whether you were using IIS 6 or 7. For IIS 7, try this: http://support.microsoft.com/kb/942043

    0 讨论(0)
提交回复
热议问题