how to get mono develop xsp2 accessible from my lan?

1.1k Views Asked by At

I am writing an asp.net mvc project on my ubuntu laptop. I want to be able to see how the website looks on my mac and winndows boxes. How can I get monodevelop to start xsp2 so that it listens on an external IP?

My ufw firewall is off. I have looked in man xsp2, I can see you can set the IP to listen on but can't see how you get monodevelop to launch it with different options.

Edit: I want to get monodevelop to start xsp2 (i.e. when I hit f5/ctrl+f5 for debugging) so it listens externally (I know how to launch it on it's own).

I did a ps -aux and found monodevelop launches xsp2 like this:

/usr/bin/mono --debug --debugger-agent=transport=dt_socket,address=127.0.0.1:35479 /usr/lib/mono/2.0/xsp2.exe --port 8080 --address 127.0.0.1 --nonstop --verbose

I need to get monodevelop to launch xsp2 with --address 0.0.0.0 but how?

Edit 2: Running this with my project dir as my current directory works fine:

/usr/bin/mono /usr/lib/mono/2.0/xsp2.exe --port 8080 --address 0.0.0.0  --nonstop

Which is ok, but I don't get the useful debugging stuff because I am running it outside of monodevelop.

I have now tried editing my web.config to add the following:

  <appSettings>
    <add key="MonoServerAddress" value="0.0.0.0" />
  </appSettings>

... which does not work. Monodevelop still launches xsp2 with 127.0.0.1 on the command line, which I take it is overriding the value in the web.config. This is the same whether I debug (f5) or run (ctrl f5).

Is it possible to get monodevelop to start xsp2 with a different --address?

3

There are 3 best solutions below

0
On

enter image description hereHave you tried going in the project options> Run> XSP Web Server> IP Address and put the IP of the computer running MonoDevelop? Like 192.168.1.x

0
On

I don't get the useful debugging stuff

It is good programming practice regardless of language being used, to run erroneous code through a debugger or the provided debugging flag (many languages provide you with a flag(parameter) that you specify whilst running the code to view potential problem points in your code.

For Mono, use the following command line parameters: --debug, --debugger-agent=transport=dt_socket,address=127.0.0.1:35479

3
On

On Windows/Visual Studio, the program that creates the asp.net aware web server is "webdev.exe".

The equivalent for Ubuntu/Mono should be "xsp2":

http://mono.wikia.com/wiki/Mono_equivalents_to_.NET

You need to:

1) Make sure your firewall is open to your xsp2 port (typically not port 80!)

2) Make sure your LAN can resolve Ubuntu's hostname (or connect to ubuntu by ipv4 address)

3) Are you using this syntax?

   mono mod-mono-server.exe [options]

http://manpages.ubuntu.com/manpages/gutsy/man1/xsp2.1.html

4) You can configure your settings (e.g. port#, protocol, etc) from the command line (as the above man page) or in AppSettings.