I came up with a necessity to work with my asp.net mvc site from a remote pc while developing. So, I configured it to use IIS Express.
At first, a problem raised with windows authentication. My site is supposed to work in windows domain intranet, so I wanted to use integrated windows authentication. I managed to make it work on firefox with How To: Firefox and Integrated Windows Authentication from IIS Express Windows Authentication (answer by bees73). But IExplorer still asks to print login/password, even if I open it locally, specifying my ip instead of localhost.
The issue with IE is still not resolved, but let it be - if I print in my credentials, it does work locally.
My question is: when I open my site on a remote PC (both in firefox (no need to print login/password) and IE (I do have to print login'n'password)) my page is rendered without applying styling. It looks like no css is available. But I don't get any errors.
In the source code of the loaded page I do have line
<link href="/Content/Site.css" rel="stylesheet" type="text/css" />
but when I try to see the Site.css, it says, there was some internal server error.
I think I did not configure IIS Express properly and that's the problem. If it was OK, the integrated windows authentication had to work without asking login and password on IE at least I guess.
So, my config:
- The project itself - to IIS Express, windows authentication - on, anonymous - off.
- netsh http add urlacl url=http://myip:myport user=domainname\mylogin
- netsh http add iplisten ipaddres=myip
- in applicationhost.config:
Bindings:
<site name="MySite" id="2"> <application path="/" applicationPool="Clr4IntegratedAppPool"> <virtualDirectory path="/" physicalPath="D:\..." /> </application> <bindings> <binding protocol="http" bindingInformation="*:myport:localhost" /> <binding protocol="http" bindingInformation="*:myport:myip" /> </bindings> </site>
Authentication:
<sectionGroup name="authentication"> <section name="anonymousAuthentication" overrideModeDefault="Deny" /> ... <section name="windowsAuthentication" overrideModeDefault="Allow" /> </sectionGroup>
<authentication> <anonymousAuthentication enabled="false" userName="" /> ... <windowsAuthentication enabled="true"> <providers> <add value="Negotiate" /> <add value="NTLM" /> </providers> </windowsAuthentication> </authentication>
<add name="AnonymousAuthenticationModule" lockItem="true" />
<location path="MySite"> <system.webServer> <security> <authentication> <anonymousAuthentication enabled="false" /> <windowsAuthentication enabled="true" /> </authentication> </security> </system.webServer> </location>