IIS Express Not Serving Static Files Over Basic Authentication
Asked Answered
C

2

9

I have a ASP.NET WEB API 2 application which was configured to use Windows Integrated Authentication and was working without an issue.

When I change the authentication mode to basic, none of the static files are served by IIS Express. Instead it returns 500. Rest of the files like aspx are getting served without an issue.

Any ideas why this might be happening?

I'm using Visual Studio 2013, but also tried it on Visual Studio 2015 and got the same result.

PS: Static files are getting served fine when deployed on a full IIS instance.

PS2: I've the following in my web.config:

<staticContent>
  <remove fileExtension=".woff2" />
  <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
  <clientCache cacheControlMode="DisableCache" />
</staticContent>

UPDATE: If I remove the

<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />

part, IIS Express serves all the static content except the .woff2 files, if I leave it in, it doesn't serve any static files.

Thanks in advance

Coulee answered 19/1, 2017 at 20:7 Comment(0)
C
2

After doing research, I figured out it was due to UAC.

Please refer to this for more information.

Coulee answered 19/1, 2017 at 21:0 Comment(0)
F
0

I had the exact same issue when trying to load babylon js files, I found the issue seems to be that ISS doesn't like being 'side loaded' with additional mime types.

Now to fix this, you could mess with the UAC for your computer, or you can add those mime types to your application host file under

%userprofile%\documents\iisExpress\config\applicationhost.config

I added mine to the top of the pile of mime types already in there:

<staticContent lockAttributes="isDocFooterFileName">
        <mimeMap fileExtension=".json" mimeType="application/text" />
        <mimeMap fileExtension=".dds" mimeType="application/dds" />
        <mimeMap fileExtension=".tga" mimeType="application/tga" />
        <mimeMap fileExtension=".fx" mimeType="application/fx" />
        <mimeMap fileExtension=".babylon" mimeType="application/babylon" />
        <mimeMap fileExtension=".babylonmeshdata" mimeType="application/babylonmeshdata" />
        <mimeMap fileExtension=".babylonbinarymeshdata" mimeType="application/babylonbinarymeshdata" />
        <mimeMap fileExtension=".cache" mimeType="text/cache-manifest" />
        <mimeMap fileExtension=".323" mimeType="text/h323" />
        .....
Fearsome answered 22/2, 2017 at 19:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.