-1

I have an ASP.NET server running under VS2010 on my PC (Win7) on port 12345.

When I load localhost:12345 in Chrome, my default page loads perfectly.
But when I load 192.168.128.104:12345 (by my internal IP, not by localhost) I get "connection refused".

Exact same behavior when I try to access the server from another device on my intranet (in my case, a Raspberry Pi)

I realize that when I hit localhost that I'm just looping back in my adapter, thus the request never leaves my machine. So it would seem that the cause is due to the request leaving & re-entering my machine.

I've create custom Inbound & Outbound rules in my Windows Firewall to allow port 12345, but to no avail.

Any ideas would be appreciated.

dlchambers
  • 3,511
  • 3
  • 29
  • 34
  • Already answered: http://stackoverflow.com/questions/18918/can-i-access-asp-net-development-server-in-an-intranet – dlchambers Jan 21 '16 at 14:29
  • Seems a different solution there, give this a try : chrome://net-internals/#dns set 'Internal DNS client enabled to true – Adam Tuliper Jan 21 '16 at 16:55
  • Thanks Adam - I did find a post on that but if you load that URL there's no such control, must be from an old version of Chrome? – dlchambers Jan 22 '16 at 12:53
  • what web server are you using? cassini? iisexpress? Ensure you are using iis express. I've tested with iis express and I don't get connection refused - http://stackoverflow.com/questions/11454624/iis-express-or-cassini – Adam Tuliper Jan 23 '16 at 06:43
  • Not IIS express, but rather full VS2010. In any case, Fiddler (see my self-answer below) solves the issue in an incredibly simple-to-set-up manner. – dlchambers Jan 24 '16 at 14:06
  • IIS Express is used by VS 2010, its not one or the other. Having to access this externally is indeed a very important point that wasn't mentioned :) See my answer below. Hope it helps! – Adam Tuliper Jan 25 '16 at 05:55

2 Answers2

0

I found the answer here:
Can I access ASP.NET Development server in an intranet?
which led me to this:
http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/UseFiddlerAsReverseProxy

As is so often the case, finding the answer is hugely dependent upon using the correct search terms. Here the critical keywords were "asp.net debug intranet"

Community
  • 1
  • 1
dlchambers
  • 3,511
  • 3
  • 29
  • 34
  • ps the above answer isn't truly applicable (although its working for you but hear me out) to your scenario because you are accessing your local address, you aren't routing outside and coming back in - the traffic never technically leaves your machine. That first post is for accessing your app running truly from another system on your network. Its a hack to get something to work that happens to make your scenario work - but your scenario. See the answer here to bind iis express to answer on any ip address using bindingInformation=":8080:" – Adam Tuliper Jan 23 '16 at 06:46
  • It is actually applicable - I have the ASP.NET server running under VS on my PC, and I have a Raspberry Pi on my network that I want to access it. Without Fiddler the Pi can't hit the server, but with Fiddler the Pi *can* hit the server. I amended my original post to include the Pi, as your "another device" comment is very relevant – dlchambers Jan 24 '16 at 14:04
0

The 'right way' here is to use IIS Express and you don't need fiddler to act as a reverse proxy. Its a hack that was used to work around using Cassini - a low budge web server that is outdated (and doesn't compare to IIS Express) and used with VS2010 prior to SP1.

In VS2010 SP1, IIS Express support was added. You can read about that here: http://blogs.msdn.com/b/webdev/archive/2011/03/14/enabling-iis-express-support-in-vs-2010-sp1.aspx

IIS Express can handle this just fine - and Visual Studio 2010 integrates with it. Its not one or the other - you develop with Visual Studio and when you launch your app it launches it with 2010.

If you want something really easy, install Visual Studio 2015 Community Edition, use ASP.NET 5 (now called ASP.NET Core 1) and simply run it to self host via the play button looking drop down you are used to seeing in VS 2010- no web server required.

Again - being that its 2016 - what you cited is a very old way. If its a quick hack, I can understand that - but if you are looking for the best practice way going forward, use IIS Express (and ideally a newer version of Visual Studio - we have them for free in the 2013/2015 Community Editions)

Hope that helps!

Adam Tuliper
  • 29,982
  • 4
  • 53
  • 71
  • Re: old tools: I totally agree. We had already planned to upgrade to VS2015 in the next couple weeks. But for now I gotta use the tools I've been given... you know how that is. I have VS2010 SP1 but not worth any interim things until I have 2015, then move forward the "right way" from there. – dlchambers Jan 25 '16 at 13:17