Enkode
Enkode

Reputation: 4783

Visual Studio 2015 impersonate URL for debugging

Is there a setting in either IIS or Visual Studio 2015 Community that I can set an Impersonated URL. I would like to debug my website locally but give the debugger the impression that the site is running on a specific domain instead of localhost?

I am using DotNetBlogEngine.Net and it has features to run several websites from a single web application. I have extended it to also allow a site to have an alias so it will run the exact same site under a different domain name. Unfortunately it is not fully working and when I go to the alias website it removes the domain and replaces it with the IP address. I would like to dive into my code and attempt debug the issue. Thanks.

Upvotes: 2

Views: 413

Answers (1)

Kaspars Ozols
Kaspars Ozols

Reputation: 7017

There is a special domain name *.localtest.me that is specially created for this purpose by some nice people. It is special by the fact that internally it resolves into 127.0.0.1 (otherwise known as localhost).

See http://readme.localtest.me

Nice thing is that does not require any modifications to the hosts file and will work on any machine with internet connection.

You can set up any number of domain names like site1.localtest.me, site2.localtest.me, etc and they all will look like real domain names and will point to localhost.

Just set up IIS bindings and/or your blog engin using required subdomains and it will work the same as it was external domain name.

Upvotes: 1

Related Questions