Search code examples
f#monovisual-studio-codewebsharperionide

WebSharper F# - How to run a template project created with VS Code and Ionide?


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


Solution

  • 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.