News

Silverlight Reborn? Check Out 'C#/XAML for HTML5'

Silverlight, the deprecated Web app development framework from Microsoft that leverages XAML and can be programmed in C#, enjoys a legion of devoted developers -- nearly as much as Visual Basic's vociferious supporters.

Thus, Microsoft's slow sunsetting of the technology -- it announced Silverlight 5's end of life in 2012 and will stop supporting it completely in 2021 -- resulted in much consternation from coders in the Microsoft ecosystem.

Now, to their rescue comes C#/XAML for HTML5 from Userware, which today announced its Silverlight-replacement project, also called CSHTML5, has reached release candidate status after a lengthy beta program.

The tool comes as a Visual Studio extension in the Visual Studio Marketplace, promising to create HTML5 apps using only C# and XAML -- or migrate existing Silverlight apps to the Web.

"Developers are now able to use C# and XAML to write apps that run in the browser," the French company said. "Absolutely no knowledge of HTML5 or JavaScript is required to use the extension, as it compiles your files to HTML5 and JavaScript for you. That means you can now build Web apps with static typing and all the strengths of C# and XAML, and make sure your code is ready when WebAssembly comes out."

WebAssembly is upcoming experimental technology presented as an open standard that lets developers write low-level assembly-like code for the browser in non-JavaScript languages like C, C++ and even .NET languages like C# for improved performance over JavaScript.

Until WebAssembly fully supported in the Web ecosystem, CSHTML5 might be seen as an alternative for .NET-centric developers.

"We support the transition between the end of Silverlight, and the arrival of WebAssembly, so that C# and XAML devs will not have to use HTML5 or JavaScript while waiting for WebAssembly, Userware's Killian Leclercq told Visual Studio Magazine.

"The feedback we had mainly is about how close to Silverlight the development experience is with CSHTML5. Our target audiences are both .NET developers looking to create (or port) Web apps using the languages they mastered over time, and companies that heavily invested in these technologies and would rather reuse everything they already built rather than start over again."

C#/XAML for HTML5
[Click on image for larger view.] C#/XAML for HTML5 (source: Userware).

CSHTML5 is browser-based only, and Userware has no plans to take it to the mobile arena, à la what Facebook did in repurposing its React framework into React Native for building native iOS and Android apps. Leclercq told VSM that Xamarin already has that space covered in the .NET ecosystem.

What the company does plan on doing is releasing CSHTML5 in version 1.0 as it waits for WebAssembly to take hold and provide .NET coders with some kind of C# compiler -- expected toward the end of this year -- followed by a XAML compiler.

"We expect XAML might take longer, though, and that’s where C#/XAML for HTML5 shines," Leclercq said. "Developers will be able to take advantage of the powerful gain in performances provided by WebAssembly on C# files, and XAML files will be compiled by CSHTML5 until a XAML compiler for WebAssembly is released."

For now, Userware claims CSHTML5 can let developers keep up to 97 percent of their existing code when they port their existing Silverlight, Universal Windows Platform (UWP) and Windows Presentation Foundation (WPF) applications to the Web, effectively reducing to only 3 percent the amount of compatibility modifications required for a successful app migration.

"I think CSHTML5 could help enterprise developers find a way of developing Web apps differently, more efficiently, and in a more productive way in the .NET ecosystem," Leclercq said. "While the extension does not pretend to be the right answer for every developer, providing them with an alternative path of development opens up much more possibilities than they have at this time."

CSHTML5 now supports 99 percent of C# features, the company said, along with 75 percent of XAML and 55 percent of .NET Core. It comes in several editions, including a free one that lacks some functionality of the others. It works with Visual Studio 2012, 2013, 2015 and 2017 (this article earlier mistakenly said it was only available through the 2013 version, as its Web site had not yet been updated).

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube