OpenSilver - Silverlight Reborn?
Written by Mike James   
Wednesday, 11 March 2020

There are many programmers who regret the passing of Silverlight - it was a great idea. Could it be that modern technology can bring it back from the dead? OpenSilver is an open source attempt at doing just that.

Back in the day Silverlight was a small miracle. You could write Windows code in C# and essentially run it in the browser with, usually, no modifications. It was also the basis for the first generation of the  Windows phone which made mobile coding particularly simple. Then, for reasons of insanity, the whole Windows 8 and WinRT based Windows Phone happened and Silverlight was dumped. It wasn't just deprecated in the manner of so much Microsoft code and left to slowly rot. As it was an alternative, a better alternative, to WinRT and hence a threat to the adoption of the new ways of doing things, it had to be stamped on and removed from the universe. This was helped along by the fact that it was a plug-in and browser add-ins were clearly evil - just look at what happened to Flash.

opensilver

Now that the dust has settled and Windows 8 and Windows Phone are both just bad memories, there has been no official reprieve for Silverlight and, given that browser plug-ins are still regarded as toxic, there isn't likely to be one.

This is where OpenSilver comes into the picture. Userware, a French software company, has been working on an open source replacement for 12 months and has just released a Preview. The good news is that it isn't a plug-in but a re-implementation using WebAssembly. It is more like a cross-compiler from C# and XAML to WebAssembly/JavaScript and HTML than a native  implementation. In this sense it isn't really like Silverlight at all, but it does the same job.

With legacy Silverlight apps facing a big problem with the end of support in October 2021, maybe OpenSilver can save the day. It might be cheaper than rewriting in a new technology.

OpenSilver is a Visual Studio extension that lets you open a new project and run it either in a simulator or using a webserver in a browser. It works with Visual Studio Community edition so you can give it a try for free. I tried it out and found that a bit rough around the edges, with things not quite working out of the box - nothing I couldn't fix in a few minutes. However, when I tried to get some of my old Silverlight programs working, I failed. I made progress, but did not get to the point where I could run something. The reason seems to be that my programs are generally "advanced" examples that make use of high resolution graphics within WPF. For example, I couldn't get WriteableBitmap or any of its associated classes to work. It is claimed that OpenSilver supports 60% of the Silverlight API, but I couldn't find a list of what is or is not supported.

If you really do need to port an existing app, then the company behind OpenSilver is offering a migration service that will presumably provide it some income to keep the whole project going as well as.

silverlight

I also have to agree with the press release that currently OpenSilver is slow. It promises a much faster performance later in the year when Microsoft adds support for Ahead-of-time compilation.

Given that there isn't a drag-and-drop designer for OpenSilver's XAML and documentation is mostly non-existent, this isn't a beginner's option. If you know Silverlight and are capable of manually editing XAML, you will probably manage to get your old apps working - but my guess is you are going to be lucky if it turns out to be trivial.

The mission statement is worth quoting:

“We are .NET developers who believe that Silverlight was the best platform ever for developing lineof-business (LOB) applications. We are sad to see Silverlight die due to the lack of support for plugins in modern browsers, so we want to save it by reimplementing it using modern, open, and standards-based technologies. We want to make it even more awesome than before, so that developers have the tools to build amazing products that can change the world.”

I think the task of making it as good as it was before is a fairly tough one, let alone making more awesome, but I hope I'm wrong. If you feel like helping there is a GitHub repro.

opensilvericon

More Information

https://opensilver.net/

Source code on GitHub

Related Articles

Silverlight Support Roadmap

Windows Phone 8 - Silverlight Apps Are Legacy

Silverlight is dead, long live Silverlight?

Silverlight 5 - the end of the line

How Microsoft Could Have Done Metro

Dumping .NET - Microsoft's Madness

Was .NET all a mistake?

Windows and .NET - the coming storm

WPF & Silverlight at risk from Microsoft's passion for HTML5

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


Does AI Help or Hinder?
02/10/2024

After early indications that AI-powered coding assistants increase developer productivity, findings are emerging that challenge this and suggest code quality may be reduced by their use. At the same t [ ... ]



JetBrains Makes WebStorm and Rider Free for Non-Commercial Use
24/10/2024

JetBrains has launched a non-commercial license for its JavaScript and TypeScript IDE, WebStorm, and for Rider, its cross-platform .NET and game development IDE.


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Last Updated ( Wednesday, 11 March 2020 )