Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS 7.5 MVC requires authentication to get static files

I have just installed windows 7 and I'm trying to get my MVC application that was working in IIS 7 working in IIS 7.5.

The problem I have is that when it tries to load any static files (css, gif, jpg...) it requires authentication. So if I try to go to:

http://example.com/Content/site.css

It redirects to:

http://example.com/Account/LogIn?ReturnUrl=/Content/site.css
like image 427
Alex Avatar asked Aug 13 '09 13:08

Alex


2 Answers

I ended up finding the problem. It seems that i need the IIS_USRS & IUSR accounts to have read access. I'm sure in vista i only had the IIS_USRS account.

like image 182
Alex Avatar answered Oct 29 '22 17:10

Alex


For me it ended up being specific static content files that required authentication, while other static content files did not require it. Turns out that those files were green in Windows Explorer. I went to properties, Advanced, on the files and turned off "Encrypt contents to secure data" and my problem was solved.

like image 22
Ryan Brubaker Avatar answered Oct 29 '22 19:10

Ryan Brubaker