About "failed to load ......" And "Web. config"

Source: Internet
Author: User

I want to use the "use web. config to set the configurations in different directories" that I saw earlier to demonstrate the inheritance of multiple web. config files.
The problem is first introduced as follows:
Put some aspx files originally placed in the root directory into authfolder and add a web. <authentication> <authorization> is not configured in the root directory. Detailed and secure configurations of these two items are required in authfolder.
The compilation is successful, but the browser prompts "failed to load ...... (A Class )".
I urgently searched some forums and found that "loading failed ......" There is almost no answer to the question, but there are only two kinds of replies: one, re-generate; two, create a virtual directory; three, create a page in authfolder, and then copyCodeInstead of directly copying the page to authfolder.
Then we can see that "the problem is still not solved..." in the response ......" .

Study it.

1. Web. config is an inheritance relationship, which is inherited from Machin. config; Machin. config has some rules for web. config: the configuration that can be configured on the web. config;
Default values: authentication and sessionstate can only be used in virtual directories and applications.Program. (Defined by allowdefinition = "machinetoapplication" in machine. config)

2. Do I have to configure the folder in IIS as an application for form verification?

3. After the sub-directory authfolder is configured as application, the page in the sub-directory will "fail to load ......" (Opposite to the search result: I configured it as a virtual directory. Why ??) If not configured, you cannot use web. config to configure <authentication> In the authfolder directory;

I tried several methods:
1. Set the subdirectory in IIS to application;
Modifying machine. config
<Section name = "authentication "...... Allowdefinition = "machinetoapplication"/>
Is
<Section name = "authentication "...... Allowdefinition = "everywhere"/>
Write the <authentication> Configuration section in Web. config of authfolder;

Failed! Or "failed to load ......"

2. Application is not configured in IIS;
Do not change machine. config;
Do not write <authentication> Configuration section in Web. config in authfolder;
Write only the <authorization> Configuration section in Web. config in authfolder and the <authentication> Configuration section in Web. config in the root directory;

Currently available, but not flexible.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.