16

I know that for many years, C# was proprietary, and it's always been focused on Windows. Then I started hearing about Microsoft releasing component after component of the language's framework as open-source. For many years Wikipedia said that the Common Language Runtime was proprietary, but now it's open source too.

How much of the language is open source now? Are there any necessary proprietary components? Could I bootstrap it given all the code that Microsoft has released? How do Microsoft's patents factor in?

1
  • 4
    You have to distinguish C# the language (older versions of which have an ECMA standard), and Microsoft's implementation of that language (Visual C#, Roslyn, …), and other implementations like the open-source Mono project (which has worked perfectly fine on Linux for many years). For the Microsoft implementation, you also have to distinguish the status of the runtime versus the multiple available standard libraries (.NET versus .NET Core). So which language version, implementation, and standard library are you asking about?
    – amon
    May 14, 2017 at 9:06

2 Answers 2

19
  1. The C# language specification is publicly available, but Copyright of Microsoft.
  2. The Roslyn compiler is licensed under Apache 2.0, so that's open source.

Could I bootstrap it given all the code that Microsoft has released?

Yes. The Roslyn compiler has been written in C# and is able to compile itself.

So, that pretty much covers the language itself. The spec is Microsoft copyright, but the ECMA officiates the spec. Microsoft's compiler implementation for that spec is open source.


Bonus round, because I have a feeling this is what you really want to know. What about the runtime and standard library? Are those open source?

Well, some of it is. Particularly, .NET Core is.

  1. CoreCLR (Common Language Runtime) is licensed under MIT.
  2. So is the standard library, CoreFx.

However, as far as I know, the Windows (desktop/classic) runtime and framework are still closed source. I suspect this is because they're tightly tied to the operating system itself. This also means that Winforms, WPF, & UWP (the desktop UI frameworks) are closed. However, much of the .NET framework is source available.


Über bonus round: There are several other open source Microsoft projects listed under The .NET Foundation.

Oh, and don't forget F#, it's libre too. All in all, Microsoft has done a wonderful job of opening its stack and inviting the community to contribute over the last few years. Despite a few missteps along the way.


Update 2020:

WPF is now open source https://github.com/dotnet/wpf

And so is WinForms https://github.com/dotnet/winforms

1

.NET is open-source and under the .NET Foundation. The .NET Foundation is an independent organization to foster open development and collaboration around the .NET ecosystem.

While you can build your own version of .NET from source code, most developers use the free, officially supported releases that are built and tested on Microsoft-maintained servers in Azure and supported just like any Microsoft product.

The programming languages, compilers, libraries, and runtimes that make up the .NET platform are all free. There are no licensing costs, including for commercial use.

The latest versions of .NET are all open-source and maintained by Microsoft and the .NET community on GitHub.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.