views:

22

answers:

1

While writing an asp.net project i may have this url for testing/debugging

http://localhost:1234/

I have code that takes in account of subdomains. Can i make visual studios call the same code with

http://anysub.localhost:1234/
+4  A: 

You can update your hosts file and put in any subdomin for the localhost:

127.0.0.1    example.com
127.0.0.1    sub.example.com

You can then point your browser to either domain. So long as the debugger are attached to IIS/Dev browser, you will be able debug your server side code.

Oded
**+1** just like I do it
sshow
@Oded, @sshow: It doesnt seem to work. I wrote `127.0.0.1 sub.localhost.com127.0.0.1 *.localhost.com` in my host file. Saw it didnt work and restarted my computer. I get a `Server not found` error in firefox, chrome and IE8. I'm using windows 7 and only using VisualStudios. I dont know if thats consider IIS/Dev browser?
acidzombie24
+1 also doing it like that here. @acidzombie24 try not using 'localhost' as the domain, not sure if it matters but that's a difference on how I'm using it.
eglasius
@eglasius: Wow, thanks eglasius. I used localdev.com and it worked perfectly. I just looked it up and wildcards arent possible. Thats so bad and now this answer is complete! accept and +1
acidzombie24