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