Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Express not serving static files to Firefox

I'm using Visual Studio 2013 with IIS Express 8 to develop an application for a local Intranet. This application was built using ASP.NET MVC 4 in Visual Studio 2012 and later migrated to 2013. I had been using Visual Studio Development Server until I migrated to VS2013 with no issues.

After the migration, the application compiles, runs and authenticates fine, but it's not serving Static Files - it just returns an HTTP 500 response with no further details. See image below:

IIS Express not serving static files

This also happens to Images and CSS files.

What can I check to solve this? Any suggestions?

UPDATE:

  • The application works fine in Local IIS (version 8).
  • It works in IIS Express on other PCs.

UPDATE 2:

  • After further testing, I found out that this only happens to Mozilla Firefox (it works fine in Internet Explorer and Google Chrome) - I didn't notice before because I always use FF. Currently using version 29.

Any ideas?

like image 871
Meryovi Avatar asked Apr 24 '14 13:04

Meryovi


1 Answers

Finally! I was able to solve this issue with the help of this question.

This was happening because Firefox by default has Windows Integrated Authentication turned off. It doesn't make any sense to me why it works fine in regular IIS or in dynamic files (controller actions, WebApi, etc.), but that's a mystery for another day.

To enable Windows Integrated Authentication I followed this steps:

  • Type about:config in Firefox's address bar (nav bar)
  • Search for network.automatic-ntlm-auth.trusted-uris
  • Double click on network.automatic-ntlm-auth.trusted-uris
  • Add http://localhost to the list (paste that if it's empty)

After that I just hit F5 in Firefox and everything worked as expected.

This issue is poorly documented, so I wonder if nobody else uses Firefox with MVC to develop web applications using Windows Integrated Authentication?

like image 195
Meryovi Avatar answered Oct 02 '22 12:10

Meryovi