Search code examples
c#.net.net-coredotnet-sdk.net-core-sdk

How many compilers .NET Framework/Core SDK does contain?


I have read a lot of articles about difference between .NET SDK and .NET Runtime, but I still don't understand what parts of .NET SDK contain compilers. I know that .NET SDK contains:

  • CLR (with JIT compiler)
  • Class libraries (BCL, FLC, etc.)
  • Documentation
  • Header files
  • compilers (csc.exe, vbc.exe)
  • ???

But .NET is multi-language platform. There are more than two languages (C#, VisualBasic). So my question is how many compilers I get when I install .NET SDK?


Solution

  • But .NET is multi-language platform. There are more than two languages (C#, VisualBasic). So my question is how many compilers I get when I install .NET SDK?

    If you're asking about distinct "top level" applications-programming languages officially supported by recent releases of the SDK for .NET 6, .NET 5, and .NET Core 3.1, then the answer is 3:

    • csc.exe or csc.dll for C#, based on Roslyn.
    • vbc.exe or vbc.dll for VB.NET, based on Roslyn.
    • fsc.exe or fsc.dll for F#.

    I don't know when the .NET SDK included the F# compiler in-box, but it was not part of the .NET Framework 4.x SDK.

    I note that normal runtime-only installations of the .NET Framework 4.x still included csc.exe, vbc.exe, and jsc.exe.

    I did some software archeology by looking through the original .NET Framework 1.0, 1.1, and SDKs and (non-SDK) runtime installers and I've compiled this table:

    Language Compiler .NET FX 1.0 .NET FX 1.1 .NET FX 2.0 .NET FX 3.0 .NET FX 4.x .NET Core 1.0 .NET Core 2.x .NET Core 3.x .NET 5 .NET 6
    C# csc.exe Runtime + SDK Runtime Runtime Runtime Runtime csc.dll csc.dll csc.dll
    VB.NET vbc.exe Runtime + SDK Runtime Runtime Runtime Runtime vbc.dll vbc.dll vbc.dll
    JScript.NET jsc.exe Runtime + SDK Runtime Runtime Runtime Runtime
    C++ for CLR cl.exe SDK SDK SDK (Windows SDK) (Windows SDK)
    J# vjc.exe SDK (Only in CD/ISO releases)
    F# fsc.exe SDK fsc.dll fsc.dll

    So if you wanted the "most" compilers in your .NET SDK, then go for .NET Framework 1.1, as that gives you five compilers.

    There was no .NET Framework 3.0, 3.5, nor 4.0 SDK as it was rolled-into the main Windows SDK.

    I don't have canonical data for .NET Core 1.0 SDK and 2.0 SDK.

    Since .NET Core 3.x, the compilers are intended to be invoked via dotnet instead of via csc.exe hence the rename from csc.exe to csc.dll.