.NET Core, you have different options for compilation and publishing.

 Certainly! When working with .NET Core, you have different options for compilation and publishing. Let’s explore them:

  1. Framework-Dependent Deployment (FDD):

    • In FDD, your application includes only your code and its dependencies (such as NuGet packages).
    • Users of the application need to have the .NET runtime installed separately.
    • The published output is a cross-platform binary (a DLL file) that can be run using the dotnet <filename.dll> command.
    • FDD is suitable when you want to rely on a shared system-wide .NET runtime.
    • To publish as framework-dependent:
      dotnet publish
      
      or for a specific platform:
      dotnet publish -r <RID>
      
  2. Self-Contained Deployment (SCD):

    • In SCD, your application includes the .NET runtime along with your code and its dependencies.
    • Users can run the application on a machine without having to install the .NET runtime separately.
    • The published output is an executable specific to the operating system and CPU architecture.
    • To publish as self-contained:
      dotnet publish -r <RID> --self-contained
      
  3. Ahead-of-Time Compilation (AOT):

    • AOT compilation converts your application’s managed code (C#) into native machine code ahead of time.
    • It improves startup performance by avoiding Just-In-Time (JIT) compilation at runtime.
    • AOT is commonly used in scenarios like mobile apps (e.g., Xamarin) or games (e.g., Unity).
    • .NET Native (for UWP apps) and CoreRT (for .NET Core) are tools for AOT compilation.


Vikash Chauhan

C# & .NET experienced Software Engineer with a demonstrated history of working in the computer software industry.

Post a Comment

Previous Post Next Post

Contact Form