OpenSilver throws Microsoft Silverlight devs a lifeline as end of support looms – or you could forget it ever happened

Open-source project migrates deprecated apps to WebAssembly


Microsoft Silverlight, now only supported in the legacy Internet Explorer, goes completely end of life on 12 October – but an open-source project called OpenSilver has appeared to convert Silverlight projects to WebAssembly.

Silverlight is a plugin developed by Microsoft in what now seems like an alternative universe, when Adobe Flash looked like it might become the de facto platform for multimedia and a strong contender for cross-platform client applications.

The first version of Silverlight appeared in 2007 as a multimedia player, but was soon followed by versions that included a cut-down .NET runtime and could run both in the browser and on the desktop, on Windows and Mac (Linux support was claimed but never fully delivered). Silverlight content and applications were defined in XAML, a slimline version of Windows Presentation Foundation. Silverlight also became the runtime for applications on Windows Phone.

Everything changed in 2010 when the late Apple CEO Steve Jobs posted his Thoughts on Flash (now sadly removed from the Apple website) confirming that Flash would not be supported on iOS. "It is not Adobe's goal to help developers write the best iPhone, iPod and iPad apps. It is their goal to help developers write cross platform apps," he wrote.

With this key platform removed, the industry focus shifted to HTML 5 and JavaScript for both multimedia and in-browser applications. Later that year, Microsoft's Bob Muglia, then president of Server and Tools, acknowledged that Silverlight too was the wrong direction, saying that "our strategy has shifted." The last major version was Silverlight 5.0 in December 2011.

But there was a period when Silverlight looked like Microsoft's direction of travel for cross-platform and browser-hosted applications, and many developers invested effort in it. Some of those may be still running today, but if so, time is being called.

"Microsoft Silverlight will reach the end of support on October 12, 2021," the company stated. "Silverlight development framework is currently only supported on Internet Explorer 10 and Internet Explorer 11, with support for Internet Explorer 10 ending on January 31, 2020. There is no longer support for Chrome, Firefox, or any browser using the Mac operating system."

Silverlight applications may continue to work, but the installer will no longer be available. Determined users should also note that IE 11 goes out of support on 15 June 2022, though IE Mode in Edge continues.

There is another option (aside from rewriting everything in JavaScript). OpenSilver is a reimplementation of Silverlight that runs in modern browsers using WebAssembly. It is open source and related to another project, CSHTML5, which compiles C# and XAML to JavaScript and HTML.

According to the docs: "The general principle for migrating a Silverlight application to OpenSilver consists of creating an OpenSilver-type project for each of the original Silverlight projects, then copying/pasting all the files from the original projects to the OpenSilver projects, and finally compiling the solution."

The company behind OpenSilver, Userware, warned that "many compilation errors are expected, since OpenSilver currently supports a subset of Silverlight functionality." There is also a problem with third-party components from the likes of Telerik or DevExpress. Sometimes these companies offer a loosely equivalent HTML/JavaScript component in which case the code can be substituted.

The OpenSilver showcase includes interop examples and a WebView control

The OpenSilver showcase includes interop examples and a WebView control

The OpenSilver Showcase shows off many of the supported features, including an impressive array of panels and controls including DataGrid and tab control, .NET capabilities including file handling, Linq and AysncAwait, access to isolated storage, use of SOAP and REST web services, and support for WebSockets.

OpenSilver is promising to release a "full version" on 12 October – when Silverlight goes out of support. That said, a quick look at the repository suggests that it is work in progress, with the key matter being the extent of the subset of Silverlight that works. On the to-do list is a new layout system, Visual Basic support, migration for WPF applications, and even support for Microsoft LightSwitch, an ill-fated but once promising development tool from times past.

The OpenSilver developers are also waiting anxiously for Ahead-of-Time (AoT) Compilation for Microsoft Blazor, coming in .NET 6.0. Blazor also runs C# in a web browser via WebAssembly, and OpenSilver makes use of it. According to its press release: "The beta version can now make use of AoT compilation for up to 15 times improved performance compared to the first release."

The existence of OpenSilver demonstrates the way in which Microsoft's various shifts of direction in its development platform has left some users stuck with technologies that have no future – see Visual Studio Tools for Office for another example.

That said, the advent of .NET Core as well as Blazor means there are now a number of options for running .NET code cross-platform or in the browser. The Uno platform is another option for Silverlight and there is a migration guide.

Why not just forget Silverlight, though? Given that some migration work is likely needed, would it not make more sense to port to a full HTML and JavaScript application, or to use Microsoft's official Blazor solution?

This OpenSilver showcase shows Silverlight content renders to HTML and JavaScript – but does not work on an iPad

This OpenSilver showcase shows Silverlight content renders to HTML and JavaScript – but does not work on an iPad

"We are .NET developers who believe that Silverlight was the best platform ever for developing line-of-business (LOB) applications," said the press release. Over a decade after Microsoft's "strategy shifted" there are those who do not want to let it go.

However, we found that the Showcase does not work properly on an iPad. Maybe by the time of "full release" it will. ®

Similar topics


Other stories you might like

Biting the hand that feeds IT © 1998–2021