Why am I getting server errors when I enable Authentication on static files?

I am upgrading my site to IIS7, .NET 4.0 and Integrated Pipeline and am having some issues.

I have a sub application (virtual directory on a remote server) in my IIS install which contains static files, 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 that looks like:
<?xml version="1.0" encoding="UTF-8"?>
    <authentication mode="Windows" />
        <allow users="?" />
I add the 2 authentication 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?
Last updated:11/4/2015 6:29:37 AM

1 Answers

Mayank Tripathi
Mayank Tripathi

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