This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14930|Reply: 0

[ASP.NET] asp.net Server error in the application. Analyzer error message: Outside of the application level, using the registration as ...

[Copy link]
Posted on 5/23/2015 11:05:54 PM | | |
asp.net Server error in the application. Analyzer error message: It is wrong to use a section registered as allowDefinition='MachineToApplication' outside of the application level. This error can occur if the virtual directory is not configured as an application in IIS.



Reason: allowDefinition="MachineToApplication" in Machine.config.

Solution 1: Set allowDefinition to: Everywhere. Considering that it is better not to change the Machine.config file, otherwise it may cause other errors.

Solution 2: <authentication mode="Forms"> is at the application level, not in the web.config at the subdirectory level
Settings, put it in the application-level web.config, and use a section in the subdirectory <authorization>to control access.


Namely: <system.web>
              <authorization>
                   <deny users="?"/>
              </authorization>
       </system.web>

web.config at root:

<authentication mode="Forms">
       <forms loginUrl="~/admin/login.aspx" name="login"   />
      
     </authentication>
     <authorization>

       <allow users="*" />
     </authorization>

(Solution 3: (I just remembered it recently) Configuring the admin subdirectory as an application should be correct, but it has not been tested and needs to be tested before it can be verified. )




Previous:Can Android be unlocked with a fingerprint? Google will release Android M: native support for fingerprint recognition
Next:The sophomore year is really hard, and there are still classes on Sunday
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com