2

I have installed Mono 4.0.2 under Windows 8.1 64bit

Now I'm testing how it runs: everything is ok with console and WF applications

However, I can't run any ASP.NET app/page. I tried my own web apps and the simple example from there, the result is the same:

  • xsp4 starts, listening on port 9000, shows root directory (webapp directory) and waits.
  • I try to access localhost:9000/, localhost:9000/hello.aspx
  • Browser keeps waiting for response forever, nothing happens in console (I tried --verbose and --loginfo).

I tried different ports and both mono.exe and xsp4.exe are in firewall exception list. IPv6 is disabled. Test-NetConnection succeeds, but telnet doesn't go further than "Connecting To 127.0.0.1..."

How do I make it work properly?

Here is that page that I'm trying to access for test:

<%@ Page Language="C#" %>
<html>
<head>
   <title>Sample Calendar</title>
</head>
<asp:calendar showtitle="true" runat="server">
</asp:calendar>

netstat output:

#just launched xsp4. 2772 is mono.exe
PS C:\Users\Orif> netstat -aon | findstr 9000
  TCP    0.0.0.0:9000           0.0.0.0:0              LISTENING       2772

#now tried to access a page through firefox (5008)
PS C:\Users\Orif> netstat -aon | findstr 9000
  TCP    0.0.0.0:9000           0.0.0.0:0              LISTENING       2772

  TCP    127.0.0.1:2199         127.0.0.1:9000         ESTABLISHED     5008

  TCP    127.0.0.1:9000         127.0.0.1:2199         ESTABLISHED     2772

UPDATE

I've installed Xamarin Studio which has own copy of xsp4. That copy works perfectly fine.

Orif Khodjaev
  • 1,080
  • 1
  • 13
  • 34
  • From netstat results, we can see TCP connections look good. Then it is the internal of XSP4 you should take a look at, so as to know what's up. – Lex Li Jul 19 '15 at 06:32

3 Answers3

0

Seems like it should be working as it is not throwing a bind error on port 9000 and thus nothing else is using that port. The calander example you listed runs fine for me with no errors.

Try some quick diagnostics:

% Turn firewall off

% Use telnet if you have it installed to see if you can connect to that port:

ps> telnet 127.0.0.1 9000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

% And test via Powershell

Test-NetConnection -ComputerName 127.0.0.1 -port 9000 -InformationLevel Detailed
~~~
TcpTestSucceeded         : True

Assuming that works fine, try the complete XSP test directory installed by Mono (located under your install path ...\lib\xsp\test)

Note: you need admin rights to that directory otherwise some of those examples for fail. Start a cmd/powershell session as admin and then cd to the test dir and start xsp4.

Still not connected?

Try using the actual IP address of your PC instead of localhost. Start up xsp4 and bind it your network IP address:

xsp4 --address=xxx.xxx.xxx.xxx --port=9000

telnet xxx.xxx.xxx.xxx --port=9000

Also checkout your hosts file to see if localhost's ip is remapped(?)

SushiHangover
  • 73,120
  • 10
  • 106
  • 165
  • Done as you said: Test-NetConnection shows TcpSucceeded : True (after a few seconds of thinking), but telnet never goes farther than "Connecting To 127.0.0.1...". I also tried rebooting :) just in case... Yet, no success. – Orif Khodjaev Jul 19 '15 at 00:12
  • If telnet can not connect then the port is being blocked. Disable firewall and re-check with telnet. And you can try a different port for xsp. – SushiHangover Jul 19 '15 at 14:18
  • Firewall is disabled, I tried with different ports, the same result. But something else is probably wrong, 'cause I can telnet remote hosts, but not localhost. I also tried to run my own app as usual in IIS Express, then tried telnet to that port - after much of thinking it said "Connection to host lost" – Orif Khodjaev Jul 19 '15 at 17:04
  • Strange, There is something blocking it if you can not get connected to your local IIS either. Have you tried the actual IP address of your PC instead of localhost? Start up xsp4 and bind it your network IP address (xsp4 --address=xxx.xxx.xxx.xxx --port=900. Also checkout your hosts file to see if localhost's ip is remapped(?) (%systemroot%\system32\drivers\etc\hosts). – SushiHangover Jul 19 '15 at 18:40
  • Thank you much for your time and effort. My hosts file is in its original state. I'm behind router's NAT, so I tried with local IP, but it didn't work. – Orif Khodjaev Jul 20 '15 at 07:46
0

If hello.aspx and hello.aspx.cs is located in /var/www/firstaspnet , then you must run xsp4 from the same directory, /var/www/firstaspnet.

Frank
  • 1,406
  • 2
  • 16
  • 42
0

It is still unclear what was causing the issue. Maybe it were system updates, or indeed it was a bug, but I've just installed Mono 4.4 and the issue is gone.

Orif Khodjaev
  • 1,080
  • 1
  • 13
  • 34