<p>When developing (works fine live) the pages for our website don't pick up the correct CSS until the user has authenticated (logged on).</p>

<p>So the Logon and Logoff forms look bad, but once inside the site, the CSS works again.</p>

<p>I'm guessing it's some kind of authentication issue? Haven't really looked into it too much because it's only when working on dev so not a huge issue, but would be nice to know how to fix it.</p>

[{'answer_id': 55597, 'author': 'RobZ', 'author_id': 3517, 'author_profile': 'https://Stackoverflow.com/users/3517', 'pm_score': 5, 'selected': True, 'text': '<p>Check and make sure that the CSS file itself is not in an area that you are securing. You can manually exclude the file via the web.config if needed.</p>\n'}, {'answer_id': 55602, 'author': 'Gulzar Nazim', 'author_id': 4337, 'author_profile': 'https://Stackoverflow.com/users/4337', 'pm_score': 2, 'selected': False, 'text': '<p>Can you try using a tool like <a href="http://fiddler2.com/fiddler2/" rel="nofollow noreferrer">Fiddler</a> or <a href="http://httpwatch.com/" rel="nofollow noreferrer">HttpWatch</a> and check if a request actually goes for the .css file from the login page. Verify the return codes are 200. Could be because of relative path issue in your dev box.</p>\n'}, {'answer_id': 417692, 'author': 'Jason', 'author_id': 38398, 'author_profile': 'https://Stackoverflow.com/users/38398', 'pm_score': 4, 'selected': False, 'text': '<p>To allow an unauthenticated user to see your .css files (or any other file/directory) you can add a location element to your web.config file pointing to the .css file.</p>\n\n<pre><code>&lt;configuration&gt;\n   &lt;system.web&gt;\n      // system.web configuration settings.\n   &lt;/system.web&gt;\n   &lt;location path="App_Themes/Default/YourFile.css"&gt;\n      &lt;system.web&gt;\n         &lt;authorization&gt;\n            &lt;allow users="*"/&gt;\n         &lt;/authorization&gt;\n      &lt;/system.web&gt;\n   &lt;/location&gt;\n&lt;/configuration&gt;\n</code></pre>\n'}, {'answer_id': 16819211, 'author': 'bejumi', 'author_id': 1011522, 'author_profile': 'https://Stackoverflow.com/users/1011522', 'pm_score': 3, 'selected': False, 'text': "<p>I just ran into this problem myself and manually adding the location made no difference. I found that I had given the IIS_IUSRS access to the folders so my application pool had no problem accessing the files but IIS was using the IUSR account for anonymous access.</p>\n\n<p>To fix it, I opened IIS Manager -> IIS: Authentication -> Select 'Anonymous Authentication' -> Click Actions: Edit.. (or right click) -> Select 'Application pool identity'</p>\n\n<p>Now anonymous access attempts use the IIS_IUSRS which have the correct file permissions.</p>\n"}]
['https://Stackoverflow.com/questions/55594', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1075/']