Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hosting asp.net on mono xsp - raspberry pi

I'm trying to run the sample application that comes with xsp package on my Raspberry Pi (running arch linux), but unfortunately apparently the connection is closed before any http response is sent to the browser. I get on chrome the "NO DATA RECEIVED" message.

xsp however just outputs "Application_Start" and nothing else happens (other than chrome saying no data received)

Here's what I do:

$ xsp2
xsp2
Listening on address: 0.0.0.0
Root directory: /srv/http/test
Listening on port: 8080 (non-secure)
Hit Return to stop the server.
Application_Start

And Chrome's output:

No data received
Unable to load the webpage because the server sent no data.
Here are some suggestions:
Reload this webpage later.
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

Of course on my Linux PC box it runs fine.

If anyone got any insights other than I'm trying to take too much out of my $35 board, let me know?

like image 611
johnildergleidisson Avatar asked Jan 16 '23 00:01

johnildergleidisson


2 Answers

For the information of whoever visits this page:

  • Raspberry pi does not have an official mono implementation on hard float operations. That's why a lot of mono stuff will NOT work, including xsp =]

  • A gentleman posted on raspberry pi forums an experimental version of mono with an implementation of hard-float which form me worked fine. The post is here.

  • For Arch Linux users, I've come up with a package build so that you can create an arch linux package, and posted on the same thread. Exactly here. Instructions on how to build it are also there.

  • Running xsp will work after this, at least for me it did. I also did use .NET to handle GPIO and all worked beautifully.

Hopefully this helps! =]

like image 111
johnildergleidisson Avatar answered Jan 27 '23 13:01

johnildergleidisson


With a bit of reflection and a socket server it's not that hard to create your own asp.net host (well I got it to support <% %> syntax with code behind and user controls (don't use/want the built in controls since they are less portable and not as transparent as I'd like)). Works fine on my arch berry.

Or you could try the self hosting from MS http://www.asp.net/web-api/overview/hosting-aspnet-web-api/self-host-a-web-api, not sure if it works with mono though (but do let us know if it does ;)).

like image 37
exstud Avatar answered Jan 27 '23 13:01

exstud