WebSharper documentation
WebSharper Core

NuGet packages

WebSharper uses NuGet packages to ship the core tools (the F#/C# to JS compilers, build automation, etc.) - often just referred to as WebSharper, proxies for the F# standard library and other .NET libraries, and bindings (also called "extensions") to JavaScript libraries. This makes it easy and predictable to add or update various WebSharper components in your applications.

Configuring the WebSharper developer feed

WebSharper and its components are available on nuget.org. In addition, if you would also like to access the latest developer packages, you can find them on the WebSharper GitHub packages feed at https://nuget.pkg.github.com/dotnet-websharper/index.json:

The standard NuGet feed should come configured on your system when installing the .NET SDK. If you want to configure the WebSharper GitHub feed as well, you can do so as follows:

dotnet nuget add source https://nuget.pkg.github.com/dotnet-websharper/index.json --name dotnet-websharper-GitHub --username <GH_USER> --password <PAT>

where GH_USER is your GitHub username, and PAT is your Personal Access Token (PAT) for your GitHub account.

GitHub requires authentication to access packages on its Packages feed. To set your access up, create a new PAT at https://github.com/settings/tokens/new with the read:packages scope, noting the expiration you configure.

If your project uses Paket, you will need to configure the above GitHub feed for Paket as well:

dotnet paket config add-credentials https://nuget.pkg.github.com/dotnet-websharper/index.json --username <GH-USER> --password <PAT>

Core NuGet packages

Below are some of the WebSharper NuGet packages that you will be working with:

Package nameWhat does it provide?
WebSharper The core package for any WebSharper project using client-side code. Includes proxies for many .NET types, the F# standard library, the core JavaScript bindings for DOM, EcmaScript, etc., the sitelets runtime with remoting and static server-side content generation, and the WebSharper Interface Generator (WIG) for creating your own JavaScript bindings. Reference it in any WebSharper project/library, along with WebSharper.FSharp or WebSharper.CSharp, depending on your source language.
WebSharper.FSharp msbuild targets/build automation to light up WebSharper features, including the main F# to JavaScript compiler.
WebSharper.CSharp Same as WebSharper.FSharp, except for C#.
WebSharper.AspNetCore Helpers to use WebSharper from an ASP.NET Core project. You only usually need it for your web projects, not libraries (unless the library builds on some ANC functionality.)
WebSharper.AspNetCore.WebSocket Strongly typed websockets implementation for WebSharper ASP.NET Core.
WebSharper.UI A highly performant, reactive UI library with type-safe templating. The recommended way to deal with reactive HTML.
WebSharper.Forms A reactive forms library built on top of WebSharper.UI, with support for declarative, composable web forms with retargetable rendering.
WebSharper.Charting A charting library with a similar API to FSharp.Charting and configurable renderers.
WebSharper.Testing A client-side testing framework for WebSharper.
WebSharper.Templates The WebSharper project templates for F# and C#.

Compiler packages

For more advanced use cases, where you need custom JavaScript compilation, you can use the following packages:

Package nameWhat does it provide?
WebSharper.Compiler.Common Core WebSharper compiler utilities shared by the F# and C# to JavaScript compilers, including offline sitelet generation.
WebSharper.Compiler.FSharp The F# to JavaScript compiler. Depends on WebSharper.Compiler.Common and FSharp.Compiler.Services.
WebSharper.Compiler.CSharp The C# to JavaScript compiler. Depends on WebSharper.Compiler.Common and Microsoft.CodeAnalysis.CSharp (a.k.a. Roslyn).
WebSharper.Compiler Includes both WebSharper.Compiler.FSharp and WebSharper.Compiler.CSharp.

On this page