IjonTichy
IjonTichy

Reputation: 114

Cannot connect to Mono Server with browser

When I follow these instructions:

ASP.Net Hello World

Create a text file with the name hello.aspx and the content:

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

Then run the xsp4 command from that directory:

xsp4 --port 9000

Use a web browser to contact http://localhost:9000/hello.aspx

at this link:http://www.mono-project.com/docs/getting-started/mono-basics/

I get this output in the command prompt:

C:\Program Files (x86)\Mono\test>xsp4 --port 9000 xsp4 Listening on address: 0.0.0.0 Root directory: C:\Program Files (x86)\Mono\test Listening on port: 9000 (non-secure) Hit Return to stop the server.

The browser just idles- seemingly forever with message in the tab-connecting until it finally times out. Anybody have any ideas what is causing this?

Upvotes: 1

Views: 606

Answers (1)

joe90p
joe90p

Reputation: 148

The same problem is described here.

I had exactly the same problem as described when trying the hello.aspx example.

I believe this roblem is caused by blank spaces in the paths where Mono is installed (by deafult in "C:\Programs (x86)").

When I run

xsp4 --port 9000

on the command line this ultimately is resolved to

"C:\Program Files (x86)\Mono\bin\mono.exe" "C:\Program Files (x86)\Mono\bin\..\lib\mono\4.5\xsp4.exe" --port 9000

I determined this by looking at the process with Process Explorer. When running this the server will have the non-response/hanging problem.

However I had previously set up a symlink "C:\programfilesx86" pointing to "C:\Program FIles (x86)" using Junction. When I use the following command

"C:\programfilesx86\Mono\bin\mono.exe" "C:\programfilesx86\Mono\bin\..\lib\mono\4.5\xsp4.exe" --port 9000

I get a response, an asp.net calendar in the case of the hello.aspx example.

So the solution seems to be to either

  1. install mono in a directory with no spaces
  2. set up symlinks as described above.

Upvotes: 1

Related Questions