0

I'm using Visual Studio 2010 with Web Development Tools. I have an ASP.net Web-Application and under project-settings using "Local IIS webserver" with project URL "http://localhost/test.mywebapp.com". This ends up in IIS under "Default WebSite".

Now when I run my webproject from within visual studio, it opens a browser with the uri like "http://localhost/test.mywebapp.com/index.aspx" - so far so good.

Now I need to access this page from another application. As a simple test, let's say I want to open a tab "test.mywebapp.com/index.aspx" in my browser and make it reach the the page runing in the debugger. I added an entry "127.0.0.1 test.mywebapp.com" to the win32/etc/hosts file. Now I open the URI in my browser, but I land at the "default" IIS7 page and not my webpage.

I tried adding a binding for the "Default Website" to test.mywebapp.com", but then it opens under test.mywebapp.com/test.mywebapp.com/index.html - also not correct...

I'm obviously missing some step mapping my URI to the correct WebSite, but I don't know how this is called or what to google for...

Any ideas?

Jon Adams
  • 22,969
  • 17
  • 78
  • 115
kalmiya
  • 2,415
  • 26
  • 31
  • I'm not sure where you're going with this, but if you wanted to use that original URL, plus the host mapping, the final URL would be: `http://test.mywebapp.com/test.mywebapp.com/index.aspx`. I'm guessing you either want to setup some kind of URL mapping, or maybe you want to change the development server path to be `/` so that the domain is only in the URL once? What is your end goal? – Jon Adams Jul 17 '12 at 13:46
  • Is your goal to run the site in IIS (not Visual Studio) but then attach Visual Studio to IIS for debugging, all while using a fully-qualified URL but that is pointing, for development, to your own machine? Is that what you're trying to do? In other words, you're describing to us _what_ you're doing, not _why_ you're doing this. There are a lots of ways to configure a site, so we need to know your end goal to advise you on how to get there. – Jon Adams Jul 17 '12 at 13:52
  • Let me try to explain what I'm trying to achieve: I have two apps 1. webapp A - a few webpages to query 2. C# application B - query webapp A Two scenario's 1. WebApp A running on remote IIS webserver (test.mywebapp.com, IIS ADD SITE) and Application B runs from debugger. 2. WebApp A _and_ Application B run locally from within the debugger, application B Now AppB does a query to WebApp A Scenario 1 works, 2 not I changed the hosts-file to reroute "127.0.0.1 test.mywebapp.com" in the hope that when my application B does a request, it ends up on webApp A running locally but that's doesn't work – kalmiya Jul 17 '12 at 14:06
  • So in Visual Studio I want to run 2 applications at the same time, my webapp using the "local IIS webserver" and my C#-application which connects to the webApp using a fully-qualified URL. – kalmiya Jul 17 '12 at 14:12
  • 1
    Is it possible to have a configuration value in App B that uses different URLs per environment? That might simplify this for you. – Jon Adams Jul 17 '12 at 17:14
  • I was thinking about doing it like that - however found another solution. Instead of doing "build/run" the web-app, I can do build/publish to a directory (inetput/wwwroot/mysite) and then in IIS I create a website pointing to that directory (instead of having it as an application under "default website" in IIS, like visual studio does). Now I only run app B only (which is okay for me, as long as I don't need to debug ^^) - and it'll nicely connect to the asp-site running locally. Only have to remember to use publish and that a "build" is not enough... – kalmiya Jul 17 '12 at 19:55

0 Answers0