Home > DeveloperSection > Forums > Why am I getting server errors when I enable Authentication on static files?
naomi burke
naomi burke

Total Post:28

Points:196
Posted on    November-04-2015 5:51 AM

 IIS 7 IIS 7  IIS 
Ratings:


 1 Reply(s)
 337  View(s)
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?


Mayank Tripathi
Mayank Tripathi

Total Post:397

Points:3117
Supported
Posted on    November-04-2015 6:29 AM

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

Don't want to miss updates? Please click the below button!

Follow MindStick