I'm trying to configure a new ASP.NET MVC3 using IIS7 express (on my local development machine) to use a custom domain name.
eg.
- my local dev machine.
- kick open my web browser
- goto http://dev.www.mydomain.com
- my visual studio mvc project kicks in
I've hacked my hosts file to include (yes, i saved the file .. which also meant i had to have admin rights enabled ...
127.0.0.1 dev.www.mydomain.com
I just can't figure out how to use IIS7 express to get configured to do this.
I went to MVC Project => Properties => Web
and did the following :-
Then tried to run the site...
Can anyone help?
I have successfully been able to accomplish debugging an IIS7-bound site similar to the above. The only step it appears you are missing is within your project:
Stop currently running site if it is running
Open
%userprofile%\documents\iisexpress\config\applicationhost.config
for VS2015+ :
$(solutionDir)\.vs\config\applicationhost.config
Locate the site you are interested in and it would have a binding like
<binding protocol="http" bindingInformation="*:<your-port-number>:localhost" />
Now add a similar entry
<binding protocol="http" bindingInformation="*:<your-port>:dev.www.mydomain.com" />
just below the above bindig entry.run the site again
NOTE: You must start visual studio as administrator because non-localhost binding requires administrator privileges
Update By Pure Krome:
Further to this, we need to do the following. These comments are in the top of my web.config (along with a few other stuff...).