3

I have never worked with .NET before and I would like to know how to run a WebSharper F# project without any IDE.

Context

  • I'm running Linux with Mono 4.4.2
  • The project was created with VS Code and Ionide, using the template websharperserverclient
  • I'm able to compile the code using the automatically generated file build.sh or by executing xbuild, but only .dll files are generated, I couldn't see any .exe

I thank in advance for any help!

Updates

Using websharperserverclient I get weird results like the one showed in the picture below and xsp4 doesn't give any hint about it.

enter image description here

boechat107
  • 1,654
  • 14
  • 24

1 Answers1

2

WebSharper can run as an ASP.NET module, so the easiest way to start your app is to run xsp4 (mono's self-hosted ASP.NET server) in the project folder. That's good as a quick server for testing; for production you should rather configure a server like Apache or nginx.

Another solution would be to use the websharpersuave template instead, which does generate a self-serving executable.

Tarmil
  • 11,177
  • 30
  • 35
  • Thanks for the answer! I tried `xsp4`, but I got only 404 errors. I'll try **websharpersuave**, but I would really like to understand what is wrong with that template. – boechat107 Sep 19 '16 at 14:33
  • Although I needed to fix manually some paths on `.fsproj` file, I was able to run a server with the template **websharpersuave**. – boechat107 Sep 19 '16 at 18:02
  • **websharpersuave** is working, but this [issue](https://github.com/intellifactory/websharper.suave/issues/9) really bothers me. Do you have another suggestion @Tarmil? – boechat107 Sep 21 '16 at 18:58
  • I have created [this repository](https://github.com/boechat107/websharper_samples) with a working example. – boechat107 Sep 26 '16 at 19:19
  • I am still figuring out the issue with the current serverclient template, but in the meantime you can check my answer to [this question](http://stackoverflow.com/questions/40190505/f-ionide-websharperserverclient-how-to-run/40203087#40203087) to switch from OWIN to HttpModule, which works with xsp. – Tarmil Oct 23 '16 at 12:54