NEW!
CSHTML5 has now become OpenSilver!

We are happy to announce that CSHTML5 has been significantly improved and rebranded to 'OpenSilver', which stands for 'Open-source reimplementation of Silverlight'. It is fully backward compatible and it can be downloaded from OpenSilver.net. Upgrading from CSHTML5 to OpenSilver is very easy.
Read the FAQ

Plugin-Free .NET in your Browser by compiling C#/XAML to JavaScript/HTML

You can finally build amazing cross-platform web apps using pure standard .NET .C#, and XAML with Visual Studio, and even compile Silverlight to JavaScript!

  • Code in C#/XAML, compile to JavaScript/HTML
  • Build rich HTML5-powered web apps with the same unmatched productivity you used to enjoy with Silverlight
  • Migrate existing Silverlight, WPF, UWP, and Xamarin apps to the web

Trusted by over 10,000 users and customers in 60+ countries

Why customers love CSHTML5

The productivity that CSHTML5 has brought feels like the good old days of Silverlight and managed to turn a few heads in the management team.

João Paulo Figueira, Frotcom International

I'm happy to report that I have a very satisfied client after a four-week build. The project includes visualizations of staff performance using complex radar charts (Polygons using Paths bound to objects with a range of custom Converters) and I'm delighted with how it performs.

Darren O'Shaughnessy, Senior Analyst, St Kilda Football Club

For a long time I have been looking for a Xaml to HTML5 solution. I couldn't understand why nobody was doing it. Finally somebody has. :-)

Andrew Tierney, CastleSoft

This IS the future. [...] This is the absolute best tool to hit Visual Studio and IS and WILL change the future of .NET and XAML. I am a huge fan, love the work, keep it up.

Michael Puckett, II

How it works

1

You download and install the extension for Visual Studio

2

You create a new project

using the "New Project" dialog of Visual Studio. Choose the project type "CSHTML5 - Empty Application"

Migrating an app from Silverlight or WPF?

Choose the project type "CSHTML5 Migration" (learn more)
3

You code in C# and XAML

as if you were writing a UWP, WPF, Silverlight, or other XAML- based .NET project (or copy/paste files if you are migrating from an existing code base)
4

You run the project

A window will appear that will generate the static HTML and JavaScript files in the bin/Debug/Output folder.
5

You launch index.html

to see your application run in the browser - no plugins are required

Looking for a great C#-based debugging experience?

Simply launch the project by clicking "Start" from within Visual Studio, and the Simulator will appear, allowing you to attach breakpoints and debug in C#
6

You deploy the HTML/JS files

by simply sharing the content of the bin/Debug/Output folder, which contains the generated HTML/JS files. For example, you can upload them to a web server to share them online

Features

Code in C#/XAML. Compile to JavaScript/HTML

Why waste time and money with JavaScript frameworks when you can use .NET, C#, and XAML to build amazing responsive HTML5 apps? You can finally reach all platforms with the skills, tools, and code base you already have.

Generate beautiful and high-performance code

New in v2.0 Thanks to the Bridge.NET technology, the generated JavaScript code is very close to the original C#, and it is almost as readable as hand-written code. (Of course it can also be obfuscated/minified for production).

Leverage the power of .NET

Most of the features that you are used to when developing .NET desktop applications are available in CSHTML5, including type safety, LINQ, Async/Await, Data Binding, WPF SOAP and REST, SignalR, IsolatedStorage, RESX, DataContractSerializer, XAML styles, User Controls, Interfaces, Inheritance, Generics, Namespaces, Event Handlers, Data Templates, Step-by-Step Debugging, Code Refactoring, Intellisense, Unit Tests, VS Source Control Integration, and so much more! cf. Which .NET types are supported?

Share code between projects

Because you write standard .NET code, you can share it between the client and the server, as well as with other project types, including UWP, Xamarin, WPF, ASP.NET, and more.

Integrate with JavaScript, React, Angular, ASP.NET...

You can call JS from C#, and C# from JS. You can also put HTML/CSS code inside your XAML code. Those features make it easy to extend beyond the build-in features and to integrate a CSHTML5 app into a React, Angular, ASP.NET, or other JavaScript-based application.

Import thousands of JS libraries into C#/XAML

You can import the thousands of existing JavaScript libraries out there and get the most out of both the .NET ecosystem and the JS ecosystem. Furthermore, the CSHTML5 compiler will automatically generate strongly-typed C# wrappers from "TypeScript Definition" files, allowing you to interact with JS libraries as if they were written in C# and XAML!

In-browser and Out-of-browser. Online and Offline

The generated HTML/JS files are simple static files that run purely client-side without the need for any particular server (of course they can communicate with servers via WCF, SOAP, REST, WebSockets, SignalR, etc., like most desktop and mobile apps do), so your application can run out-of-browser (it can be packaged as a standalone executable via Electron, or as an app via Cordova/PhoneGap), and it can even run offline.

Open Source and Dual Licensed for peace of mind

The product source code is available on GitHub, so you have everything you need to be independent forever and to have full control of the code. All the features are 100% free for hobbyists, open-source contributors, and academics, and an affordable commercial license is available for freelancers and organizations, which allows for commercial use, and provides best-in-class support and assistance.