0

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?

simon
  • 1,840
  • 2
  • 18
  • 34

3 Answers3

1

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

thejartender
  • 9,339
  • 6
  • 34
  • 51
passer-by
  • 11
  • 1
0

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

R.Silva
  • 11
  • 3
0

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.

paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • as I said, my firewall is off. Yes I am connecting to the correct IP and port number (8080), and I have connectivity form my mac/windows boxes to my laptop. I've edited my question to make it a bit more clear. – simon Sep 04 '11 at 21:54
  • Q: You say you "know how to launch it on it's own". Does this mean you've successfully bound to IN_ANY (0.0.0.0), and that you've successfully connected from external clients when you launched it manually? What syntax did you use? Q: Otherwise, did you try any of the available command-line options and/or AppSettings file settings? – paulsm4 Sep 04 '11 at 22:18
  • Running it manually is fine (edit 2 above). Good point on the appsettings. Somehow missed that when I first looked at the man page. Unfortunately, it seems to have no effect setting MonoServerAddress as described above.I'm starting to think this may be a limitation of the monodevelop asp.net debugging environment. – simon Sep 05 '11 at 08:23