. NET Web site App_Data folder does not have direct access to the solution

Source: Internet
Author: User

When developing a Web site, it is necessary to record errors and business execution logs. We use log4net as our. NET Web site's logging framework, the log file format is. txt, which is saved in the App_Data directory.

After logging the log, we are debugging the site and testing the progress of the site is often required to view the log, very old-fashioned way is to open the Web server, enter the App_Data folder to find the log file, and then open with Notepad, so that the way to view the log effect is particularly low, So I thought of accessing the log file directly through the URL, and found that access was denied because of insufficient permissions. On-line Baidu's n methods, the results found to change the file permissions and no use of eggs.

But the effort is not negative, inadvertently found the solution. Why is the App_Data directory rejected? That's because the Windows system defaults to the directory's access restrictions within its host configuration file, and here's the solution:

1. Open C:\Windows\System32\inetsrv\config Path

  

2. Open the ApplicationHost.config configuration file and locate the Hiddensegments configuration section

  

3, delete <add segment= "App_Data" > Configuration items can!

. NET Web site App_Data folder does not have direct access to the solution

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.