Can I access ASP.NET Development server in an intranet?
Asked Answered
S

10

47

Im testing an ASP.NEt site. When I execute it, it starts the ASP.NET Development Server and opens up a page.

Now I want to test it in the intranet I have.

  1. Can I use this server or I need to configure IIS in this machine?

  2. Do I need to configure something for it to work?

I've changed the localhost to the correct IP and I opened up the firewall.

Thanks

Stater answered 20/8, 2008 at 21:41 Comment(1)
Maybe it helps someone else: you can use www.browserstack.com to access VMs with different browser versions directly from the dev machine. (i have no affiliation with the company)Stater
M
50

Yes you can! And you don't need IIS

Just use a simple Java TCP tunnel. Download this Java app & just tunnel the traffic back. http://jcbserver.uwaterloo.ca/cs436/software/tgui/tcpTunnelGUI.shtml

In command prompt, you'd then run the java app like this... Let's assume you want external access on port 80 and your standard debug environment runs on port 1088...

java -jar tunnel.jar 80 localhost 1088

(Also answered here: Accessing asp. net development server external to VM)

Martella answered 12/9, 2011 at 22:49 Comment(8)
+1 I think this answer is much more useful, since it allows you to debug a request coming from an external machine. Personally, I use this tunnel software: pocketsoap.com/tcpTraceConservator
Good suggestion! The Java TCP tunnel is super slow, so maybe the pocketsoap one is a better choice.Martella
I think is should be marked as the best answer. This is the most non-intrusive way of getting things to work. Plus, you also get to watch the data packets.Crossruff
It works like a charm. I have tested RINETD but it doesn't work with me. strongriley, Thanks a lot.Indent
I tried this solution but it seems that it only works on 1 network card. I have 2 network cards, and I wanted to tested on my second card (different networks) and it failed. I went with a Wamp Server with a Proxy module in the endEarthward
Don't waste your time with java! Just use fiddler: fiddler2.com/documentation/Configure-Fiddler/Tasks/…Wrought
Unfortunately your link is dead. I'm trying to access my running VS server from another machine on the same LAN, any ideas?Educatory
TcPTrace did not work for me, Casini continued to reject the connection. Fiddler reverse proxy did work.Lout
K
20

No, you can't. It's set up so it only works on localhost, and I couldn't find any workarounds to make it work.

But, here's what I've been doing - I created the website on a specific port in IIS and opened that port up so it's visible on the network. I pointed that IIS website to my website's root folder (the one with web.config in it). Then I continued to use the ASP.NET Development server on that local machine while developing - both IIS and the ASP.NET Development Server can access the files at the same time (unless you're doing something wacky).

Let me know if there's a challenge with running IIS on your machine and I'll update my answer.

Kite answered 20/8, 2008 at 21:47 Comment(0)
M
6

I realize this isn't a direct answer to your question, but an alternative to debugging using the ASP development server is to attach to the IIS process: How do I attach the debugger to IIS instead of ASP.NET Development Server?

Monney answered 19/7, 2010 at 18:32 Comment(0)
O
5

Nope, stupidly (IMHO) there's no way to get the default ASP.net development server to serve pages to IPs other than localhost. What I did was to use UltiDev Cassini which is very quick to set up and is basically a version of the ASP.net development server compiled by UltiDev, and it will serve pages to any IP address.

Oldfangled answered 4/8, 2010 at 11:5 Comment(0)
S
4

Just for those who don't want/cant set up IIS for whatever reason...

Use fiddler or similar on your host - set your browser on the client VM to use the proxy then just use localhost:dev_port as usual on the client.

All requests from the client goto the proxy on your dev machine which routes to localhost on the dev machine and the ASP.net dev server thinks the request is from your dev machine!

Scrobiculate answered 17/8, 2012 at 14:59 Comment(0)
M
3

You can recompile Cassini to get it to work - there's a fairly easy to remove check for localhost in there. Or, I'm pretty sure Ultidev's Cassini doesn't have this restriction. Both of these are easier to setup than IIS.

But, yeah, the builtin WebDev.WebServer doesn't work....Hmm, unless you run something like AnalogX's Proxy on your dev box and point it to the WebDev port. That should work (though I haven't tried it, it should take < 2 mins to setup).

Minority answered 20/8, 2008 at 21:54 Comment(0)
E
3

You can use Cassini to expose your web apps externally. You just need to proxy the connection. I wrote a simple program to do this that you can run in another VS instance. Just change the port to match the port Cassini is using.

https://gist.github.com/945649

Etherealize answered 28/4, 2011 at 1:57 Comment(1)
This didn't work for me, just to confirm the port number that needs changing is 1374?Tattler
P
2

You can do port redirection using SOAP Toolkit 3.0

Once installed, go to My Programs > Microsoft Soap Toolkit 3 > Trace Utility

Once Trace Utility opened, go to File > New > Formatted Trace

In the dialog insert your ASP .NET Development Server port in Forward To Destination Port field.

It's only a workaround for testing purposes

Parahydrogen answered 27/5, 2011 at 12:5 Comment(1)
Can you please give more information? I did exactly as you suggested, now what do i do? going to 10.0.0.3:8080 from an intranet comp did not workEsparza
Z
1

I believe the built in ASP.NET server only works on localhost. You'll have to use IIS.

Zingg answered 20/8, 2008 at 21:42 Comment(0)
D
1

Compile all you website in Debug mode, then create the website and publish it in IIS (make sure you can view it from other machine). Then attach the VS2010 Debugger to the process with the AppPool of your website (the process is called w3wp.exe when IIS>v5 and aspnet_wp.exe when IIS<5).

If you make some changes, just replace the package contents on the physical path of the website, and there you go again.

Derivation answered 18/5, 2012 at 16:38 Comment(2)
No need to apologize for posting a late answer, that's what this site is all about! However, I do not see how your answer relates to the question at hand. The point of this question is specifically about how to use the development server -- i.e. how not to use IIS.Accommodative
What I'm trying to point here is one way to debug an ASP application using the real IIS... you can't mimic the true behavior of a web application in the development server... but if you use the full IIS, you can send things to the server, mimic post and get, and so on... that's my point and I think this answer fits here... as an alternative way to "debug ASP app"Derivation

© 2022 - 2024 — McMap. All rights reserved.