1

I am just beginning with C# . net programming, a book i read states that the FCL has many useful classes for many tasks.

My question is, does it mean that microsoft has created different versions of FCL for different .net compliant languages or, the FCL is written MSIL(microsoft intermediate language) so that only one copy of FCL is needed?

DesirePRG
  • 6,122
  • 15
  • 69
  • 114
  • While linked duplicate provides you an answer you can also look at most of the sources yourself (search for "Microsoft reference source" or use links covered in recent answers to http://stackoverflow.com/questions/1938566/where-can-i-find-source-code-for-net-clr-and-c) – Alexei Levenkov Mar 20 '15 at 05:51
  • I don't know anything about the base class library, and the answers in that question doesn't answer mine – DesirePRG Mar 20 '15 at 06:31
  • I see. If you don't like [BCL vs FCL](http://stackoverflow.com/questions/807880/bcl-base-class-library-vs-fcl-framework-class-library) answer: "FCL ... While these classes are themselves written in C#, they can be used from any CLRbased language" than good Hans Passnat's answer properly reiterates it with higher rep. – Alexei Levenkov Mar 20 '15 at 14:37

1 Answers1

1

No, there is just one implementation. A strong design goal in .NET was to make the framework implementation available to many languages. Enforced by encoding the content of a .NET assembly, metadata and code, in a language-independent format. Described by the CLI specification, Ecma-335. Every .NET compiler adheres to that standard so code you write in one language can be used by any other .NET language compiler.

And there's platform independence, achieved by the just-in-time compiler, it converts the MSIL in the assembly to machine code that matches the kind of processor that the machine uses. Not quite as flexible as language independence, this does require a version of the CLR that is capable of executing on the machine's operating system. And some FCL features might not be supported, something like WPF can only be used on Windows.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • does it mean that the FCL was written in C# and compiled into MSIL, so that other .Net compliant languages can use the MSIL version of the class library? – DesirePRG Mar 20 '15 at 09:28
  • Yes. With the minor detail that not all of it was written in C#, some of the FCL assemblies contain code written in C++. – Hans Passant Mar 20 '15 at 09:44