title: Prevent Anonymous Access to Content of the folder in .Net Framework 4.5
body: <p>I have this following section in my web.config file in ASP.Net 4.5 project.</p>
  
  <p>I've added couple of .doc files into that folder. 
  Whenever I run the project (either logged in or logged out) through VS 2012, It allows me the direct access to the files inside that folder. I need to protect the anonymous users from accessing to the files.</p>
  
  <pre><code>HTTP://localhost/Test/Test1.doc
  </code></pre>
  
  <p>But when the URL is <code>HTTP://localhost/Test</code> it redirects me to login page.</p>
  
  <pre><code>&lt;location path="Test"&gt;
      &lt;system.web&gt;
        &lt;authorization&gt;
          &lt;deny users="?" /&gt;
       &lt;/authorization&gt;
      &lt;/system.web&gt;
  &lt;/location&gt;
  </code></pre>
  
  <p>I wonder how it was working before in .Net Framework 4 on VS 2010.
  It prevents the anonymous users from accessing to the content of the folder.</p>
  
  <p>Did I miss any settings in my web.Config file using . Net Framework 4.5?</p>