WHY AM I GETTING SERVER ERRORS WHEN I ENABLE AUTHENTICATION ON STATIC FILES?

naomi burke

Total Post:28

Points:196
Posted by  naomi burke
IIS 7  IIS 
 576  View(s)
Ratings:
Rate this:
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"?>
<configuration>
<system.web>
    <authentication mode="Windows" />
    <authorization>
        <allow users="?" />
    </authorization>
</system.web>
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?
  1. Mayank Tripathi

    Post:397

    Points:3117
    Re: Why am I getting server errors when I enable Authentication on static files?

    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!