Downloads
Create your WebSharper project quickly.
Getting Started with WebSharper
- The simplest way is to use the dotnet CLI.
- If you are using Windows, you can also install the Visual Studio extension.
-
The above options provide project templates to get you started quickly. You can also use WebSharper by simply adding it to an existing project with NuGet and
a wsconfig.json configuration file.
$ dotnet add package WebSharper.FSharpor$ dotnet add package WebSharper.CSharp
WebSharper also has many bindings for popular JavaScript libraries. Download them from NuGet.
Using WebSharper with the dotnet CLI
The WebSharper dotnet templates can be used to create ASP.NET Core-based projects.
Install the WebSharper project templates
To install the WebSharper project templates, use the following command:
To update the templates to the latest version, you can use:
Create a new WebSharper project
You can create multiple types of project, both in C# and F#.
-
The Web template creates an ASP.NET Core-hosted WebSharper application with both server-side and client-side code. Create it with:
$ dotnet new websharper-web -lang f# -n ClientServer -
The SPA template creates an ASP.NET Core-hosted Single-Page Application. Create it with:
$ dotnet new websharper-spa -lang f# -n SPA -
The Library template creates a simple class library compiled with WebSharper. Create it with:
$ dotnet new websharper-lib -lang f# -n Library -
The HTML template creates a statically-generated website. Create it with:
$ dotnet new websharper-html -lang f# -n Offline
Where to go next?
Learn how to use WebSharper:
- Discover sitelets: serving content, defining an HTTP APIs, using JSON, etc.
- Learn about building reactive web UIs: using HTML templates, adding dynamic behavior, handling client-side state, etc.
- Read the basics: setting up projects, using project templates, and understanding compilation.
- Play with online examples: edit and run WebSharper snippets, and use them to bootstrap your projects
- Browse available NuGet packages. find WebSharper libraries and add them to your projects.
-
Learn about configuration:
understand
wsconfig.jsonand other project settings. - Deploy your application: tips for publishing to servers, cloud, or static hosting.
Engage with the community: