---
title: "Why am I getting server errors when I enable Authentication on static files?"  
description: "Why am I getting server errors when I enable Authentication on static files?"  
author: "Anonymous User"  
published: 2015-11-04  
updated: 2015-11-04  
canonical: https://www.mindstick.com/forum/33569/why-am-i-getting-server-errors-when-i-enable-authentication-on-static-files  
category: "iis 7"  
tags: ["iis 7", "iis"]  
reading_time: 1 minute  

---

# Why am I getting server errors when I enable Authentication on static files?

I [am upgrading](https://answers.mindstick.com/qa/49949/i-am-upgrading-from-10-6-8-to-el-capitan-i-m-being-told-that-microsoft-excel-and-word-won-t-work-any-ideas-on-how-to-convert) my site to IIS7, .NET 4.0 and [Integrated](https://www.mindstick.com/forum/33532/handler-pagehandlerfactory-integrated-has-a-bad-module-managedpipelinehandler-in-its-module-list) [Pipeline](https://yourviews.mindstick.com/view/83647/building-a-successful-organic-traffic-pipeline-in-5-easy-steps) and am having some issues.\
I have a sub [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) (virtual [directory](https://www.mindstick.com/forum/226/how-to-get-application-directory-using-c-sharp-csharp) on a remote server) in my IIS [install](https://www.mindstick.com/articles/12876/the-top-5-reasons-to-buy-and-install-a-tonneau-cover) which contains [static files](https://www.mindstick.com/forum/161501/how-to-re-use-godaddy-cdn-static-files-like-css-js), and I want it to be authenticated using WindowAuthentication where as the rest of my site will be using FormsAuthentication.\
It has a [web.config](https://www.mindstick.com/forum/183/web-config-file) that looks like:

```
<?xml version="1.0" encoding="UTF-8"?><configuration><system.web>    <authentication mode="Windows" />    <authorization>        <allow users="?" />    </authorization></system.web>
```

I add the 2 [authentication](https://www.mindstick.com/blog/177/authentication-and-authorization-in-asp-dot-net) modules in the parent web.config and remove the default managedOnly precondition. Although, obviously because of the remove statement the directory is not under any authentication. However if I remove those lines, I get a generic server 500 error. Am I missing [something else](https://www.mindstick.com/forum/1654/can-anybody-say-my-below-code-is-a-variable-function-or-something-else)?

## Replies

### Reply by Anonymous User

Okay, so the reason this was happening was actually pretty simple, the application didn't have a Bin directory and so it didn't have any of the DLLs it needed and so it was throwing an error because it didn't know how to create a new WindowsAuthenticationModule


---

Original Source: https://www.mindstick.com/forum/33569/why-am-i-getting-server-errors-when-i-enable-authentication-on-static-files

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
