如何从我的局域网访问单声道开发xsp2?
我正在我的 ubuntu 笔记本电脑上编写一个 asp.net mvc 项目。我希望能够看到该网站在我的 Mac 和 Windows 机器上的外观。我怎样才能让 monodevelop 启动 xsp2 以便它侦听外部 IP?
我的 ufw 防火墙已关闭。我查看了 man xsp2
,我可以看到您可以设置要侦听的 IP,但看不到如何让 monodevelop 使用不同的选项启动它。
编辑: 我想让 monodevelop 启动 xsp2 (即当我点击 f5/ctrl+f5 进行调试时),以便它在外部监听(我知道如何自行启动它)。
我做了一个 ps -aux
并发现 monodevelop 像这样启动 xsp2:
/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
我需要让 monodevelop 使用 --address 0.0.0.0
启动 xsp2 但如何呢?
编辑2:使用我的项目目录运行它,因为我的当前目录工作正常:
/usr/bin/mono /usr/lib/mono/2.0/xsp2.exe --port 8080 --address 0.0.0.0 --nonstop
这很好,但我没有得到有用的调试内容,因为我在 monodevelop 之外运行它。
我现在尝试编辑我的 web.config 添加以下内容:
<appSettings>
<add key="MonoServerAddress" value="0.0.0.0" />
</appSettings>
...这不起作用。 Monodevelop 仍然在命令行上使用 127.0.0.1 启动 xsp2,我认为它覆盖了 web.config 中的值。无论我调试(f5)还是运行(ctrl f5),这都是一样的。
是否可以让 monodevelop 使用不同的 --address 启动 xsp2?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
无论使用什么语言,通过调试器或提供的调试标志运行错误的代码都是很好的编程实践(许多语言为您提供在运行代码时指定的标志(参数))要查看代码中的潜在问题点,
请使用以下命令行参数:
--debug
,--debugger-agent=transport=dt_socket,address=127.0.0.1:35479
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
在 Windows/Visual Studio 上,创建支持 ASP.NET 的 Web 服务器的程序是“webdev.exe”。
Ubuntu/Mono 的等效项应该是“xsp2”:
http://mono.wikia.com/wiki /Mono_equivalents_to_.NET
您需要:
1) 确保您的防火墙对 xsp2 端口开放(通常不是端口 80!)
2)确保您的 LAN 可以解析 Ubuntu 的主机名(或通过 ipv4 地址连接到 ubuntu)
3) 您使用此语法吗?
http://manpages.ubuntu.com/manpages/gutsy/man1/xsp2 .1.html
4) 您可以从命令行(如上面的手册页)或在 AppSettings 中配置您的设置(例如端口号、协议等)。
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?
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.
您是否尝试过进入项目选项>运行> XSP Web 服务器> IP 地址并输入运行 MonoDevelop 的计算机的 IP?像192.168.1.x
Have 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