Question

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
Was it helpful?

Solution

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.

OTHER TIPS

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.

It looks like you've messed up with something.

If you take the ASP.NET MVC template application (the one created when you start a new MVC Project), it won't require authorization to download static content.

If you provide more information, like your routes, or something else, it will be easier to understand your problem and find a solution for it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top