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
Extension | Source Code | How it works |
---|---|---|
WebSockets extension | Link | It wraps the native JavaScript "WebSocket" class into a C#-based class that can be consumed by CSHTML5 applications. |
Print extension | Link | It extracts the HTML DOM element that corresponds to the specified FrameworkElement, copies it into a new browser window, and then calls the browser Print command on the new window. |
File Open Dialog extension | Link | It adds the <input type='file'> tag to the HTML DOM, and listens to the JavaScript "Change" event to return a JS blob or text. |
File Save extension | Link | It wraps the open-source JavaScript "FileSaver.js" library into a C#/XAML class for consumption by CSHTML5-based apps. |
Unofficial ArcGIS Mapping Control for CSHTML5 | Link | It wraps the JavaScript-based version of the ArcGIS mapping library into a C#/XAML-based control that can be consumed from pure C#/XAML code. |
ZIP Compression extension | Link | It wraps the open-source JavaScript "JSZip.js" library into a C#/XAML class that mimics the method signatures of Ionic.Zip (DotNetZip). |
Many more open-source extensions can be found on the Extensions Gallery page.
Read the page How to call JavaScript from C# to see the answer to those questions.
To publish your extension, just distribute the DLL that is in the "bin/Debug" subfolder of your CSHTML5 class library folder (refer to the "General Concepts" section above for details). End-users will be able to use it by clicking "Add Reference" from the Solution Explorer.
You can distribute your extension by posting a message on the Extensions and Plugins section of the forums. It is a good place to quickly find end-users to try out your extension. To do so, just compress your DLL into a ZIP archive and send it as an attachment to a new forum post.
Please contact us if you need more information about how to publish an extension.
While creating an application or an extension with CSHTML5, you may encounter compilation errors that say that Feature X is not yet supported. This happens only with features that exist in MSCORLIB (.NET Core) and not in CSHTML5. It does not happen with missing features that exist elsewhere in the .NET Framework, because the error message is different in that case.
The JavaScript implementation of MSCORLIB is provided by the open-source project JSIL. Only a subset of MSCORLIB has been implemented. You can see the JavaScript files that contain the MSCORLIB implementation by opening the following folder on your computer:
C:\Program Files (x86)\MSBuild\CSharpXamlForHtml5\InternalStuff\Libraries
To implement missing MSCORLIB features, you have 2 possibilities: either implement the missing features by working directly on the JSIL solution, or implement the missing features by modifying the JSIL files that are contained inside CSHTML5. At the end, the result is the same, because any contribution you make to JSIL will be merged by us into CSHTML5.
Please click here for contact information.