0

I would like some suggestions regarding testing a web application (ASP.Net MVC 3 in my case) from multiple URL's.

The site will behave differently based on which domain name the request is coming from. Nothing fancy, just loading different layouts with a few other simple bits and bobs.

Currently, the web.config contains the valid domains the code acts upon and everything seems to be working fine so far.

Whenever I hit Run in Visual Studio, it fires up the developer server instances with the usual localhos:xxxx address. If I want to test each layout in VS, I need to configure localhost to be associated with the layout I wish to load.

I could manage to live with how it is right now, but everything is on TFS, so if someone checks out the file (for testing) and forgets to check back in, it can cause some headaches.

So I was wondering if anyone had some decoupled way to fire up a site with a specific address while maintaining the ability to easily debug (preferably not by deploying to IIS)

Thanks.

1 Answer 1

1

You could associate some domain name to localhost in your hosts file:

127.0.0.1 foo.com 

And then navigate to http://foo.com:xxxx

Sign up to request clarification or add additional context in comments.

1 Comment

As Darin explained. You can find the hosts file here: C:\Windows\System32\Drivers\etc\hosts

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.