Convert Figma logo to code with AI

dotnet logoruntime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.

14,915
4,635
14,915
8,894

Top Related Projects

14,331

This repo is the official home of .NET on GitHub. It's a great starting point to find many .NET OSS projects from Microsoft and the community, including many that are part of the .NET Foundation.

11,073

Mono open source ECMA CLI, C# and .NET implementation.

12,810

CoreCLR is the runtime for .NET Core. It includes the garbage collector, JIT compiler, primitive data types and low-level classes.

17,679

This repo is used for servicing PR's for .NET Core 2.1 and 3.1. Please visit us at https://github.com/dotnet/runtime

20,851

.NET news, announcements, release notes, and more!

18,892

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.

Quick Overview

The dotnet/runtime repository is the core runtime implementation for .NET, including CoreCLR, the Core .NET libraries, and the garbage collector. It's a fundamental part of the .NET ecosystem, providing the essential components for running .NET applications across various platforms.

Pros

  • Cross-platform support for Windows, macOS, and Linux
  • High performance and scalability for enterprise-level applications
  • Active development and regular updates from Microsoft and the community
  • Extensive documentation and resources for developers

Cons

  • Steep learning curve for newcomers to .NET development
  • Large codebase can be challenging to navigate and contribute to
  • Some legacy components may require ongoing maintenance
  • Occasional breaking changes between major versions

Code Examples

  1. Basic console application:
using System;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Hello, .NET Runtime!");
    }
}
  1. Asynchronous programming with Task:
using System;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        await Task.Delay(1000);
        Console.WriteLine("Async operation completed.");
    }
}
  1. Using LINQ for data manipulation:
using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        int[] numbers = { 1, 2, 3, 4, 5 };
        var evenNumbers = numbers.Where(n => n % 2 == 0);
        Console.WriteLine(string.Join(", ", evenNumbers));
    }
}

Getting Started

To get started with .NET development:

  1. Install the .NET SDK from https://dotnet.microsoft.com/download
  2. Create a new console application:
    dotnet new console -n MyApp
    cd MyApp
    
  3. Build and run the application:
    dotnet build
    dotnet run
    

For more advanced usage and contribution to the runtime itself, refer to the repository's CONTRIBUTING.md file and developer documentation.

Competitor Comparisons

14,331

This repo is the official home of .NET on GitHub. It's a great starting point to find many .NET OSS projects from Microsoft and the community, including many that are part of the .NET Foundation.

Pros of dotnet

  • More comprehensive documentation and resources for developers
  • Broader scope, covering the entire .NET ecosystem
  • Easier entry point for newcomers to .NET development

Cons of dotnet

  • Less focused on core runtime implementation details
  • May not provide as deep insights into low-level optimizations
  • Updates and releases might not be as frequent as runtime

Code Comparison

runtime:

internal static unsafe void* Alloc(nuint size)
{
    void* result = NativeMemory.Alloc(size);
    if (result == null)
        throw new OutOfMemoryException();
    return result;
}

dotnet:

public static void Main(string[] args)
{
    Console.WriteLine("Hello, .NET!");
    // More high-level application code
}

The runtime repository focuses on low-level memory management and core functionality, while dotnet typically contains higher-level application code and examples. runtime provides deeper access to internal workings of .NET, whereas dotnet offers a more user-friendly approach to .NET development with a broader range of topics and resources.

11,073

Mono open source ECMA CLI, C# and .NET implementation.

Pros of mono

  • Longer history and established ecosystem for cross-platform .NET development
  • Supports a wider range of platforms, including some legacy systems
  • More flexible licensing options (MIT X11 for core, LGPL for class libraries)

Cons of mono

  • Generally slower performance compared to modern .NET Core/.NET 5+
  • Less frequent updates and potentially slower adoption of new C# features
  • Smaller active community and fewer contributors in recent years

Code comparison

mono:

using System;
class Program {
    static void Main() {
        Console.WriteLine("Hello from Mono!");
    }
}

runtime:

using System;
class Program {
    static void Main(string[] args) {
        Console.WriteLine("Hello from .NET Core!");
    }
}

The code examples are nearly identical, reflecting the compatibility between the two implementations. The main difference is in the runtime environment and available APIs rather than the basic syntax.

12,810

CoreCLR is the runtime for .NET Core. It includes the garbage collector, JIT compiler, primitive data types and low-level classes.

Pros of coreclr

  • More focused scope, specifically on the CoreCLR runtime
  • Easier to navigate for developers primarily interested in the CLR
  • Historical context and legacy codebase for reference

Cons of coreclr

  • No longer actively maintained as a separate repository
  • Limited to CoreCLR components, lacking broader .NET runtime features
  • Potentially outdated documentation and issue tracking

Code Comparison

coreclr:

public static unsafe int Main(string[] args)
{
    fixed (char* pArgs = args[0])
    {
        return RunMain(pArgs, args.Length);
    }
}

runtime:

public static int Main(string[] args)
{
    return ProgramMain(args);
}

Summary

The coreclr repository was specifically focused on the CoreCLR runtime, while runtime is a more comprehensive repository that includes CoreCLR along with other .NET runtime components. The runtime repository is now the primary location for .NET runtime development, offering a more unified and up-to-date codebase. However, coreclr may still be valuable for historical context and specific CLR-related research. The code comparison shows a simplified main method in runtime, reflecting ongoing efforts to streamline and modernize the codebase.

17,679

This repo is used for servicing PR's for .NET Core 2.1 and 3.1. Please visit us at https://github.com/dotnet/runtime

Pros of corefx

  • More focused scope, specifically on .NET Core base class libraries
  • Easier to navigate for developers working on specific BCL components
  • Historical context and discussions available for older .NET Core versions

Cons of corefx

  • No longer actively maintained, as functionality has moved to runtime
  • May contain outdated information or code that's no longer relevant
  • Lacks integration with newer .NET runtime components

Code comparison

corefx:

public static class Console
{
    public static void WriteLine(string value)
    {
        // Implementation
    }
}

runtime:

public static class Console
{
    public static void WriteLine(string? value)
    {
        // Updated implementation with nullable reference types
    }
}

Summary

The corefx repository was the original home for .NET Core base class libraries. It provided a focused environment for BCL development but is now archived. The runtime repository has absorbed corefx's functionality, offering a more integrated approach to .NET development. While corefx still holds historical value, developers should refer to runtime for the most up-to-date .NET Core implementation. The code comparison shows subtle differences, such as the adoption of nullable reference types in runtime, reflecting the evolution of C# language features.

20,851

.NET news, announcements, release notes, and more!

Pros of core

  • More focused on high-level framework components and APIs
  • Easier to navigate for developers working on application-level features
  • Contains more user-facing documentation and samples

Cons of core

  • Less comprehensive coverage of low-level runtime components
  • May not provide as much control over performance-critical internals
  • Smaller community and fewer contributors compared to runtime

Code Comparison

core:

public class Program
{
    public static void Main(string[] args)
    {
        CreateHostBuilder(args).Build().Run();
    }
}

runtime:

internal static class Program
{
    private static int Main(string[] args)
    {
        return RuntimeBootstrapper.Run(args);
    }
}

The core example shows a typical entry point for a .NET Core application, while the runtime example demonstrates a lower-level bootstrapping process used in the runtime itself.

18,892

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.

Pros of Roslyn

  • Focused on compiler and language services, making it more specialized and potentially easier to contribute to
  • Provides a rich API for code analysis and manipulation, enabling powerful tooling and extensions
  • Supports multiple .NET languages (C# and Visual Basic)

Cons of Roslyn

  • Narrower scope compared to runtime, which may limit its applicability in certain scenarios
  • Steeper learning curve for contributors due to its complex language processing capabilities
  • Potentially slower development cycle for major features due to its focus on language specifications

Code Comparison

Roslyn (C# syntax analysis):

var tree = CSharpSyntaxTree.ParseText("class Program { }");
var root = tree.GetRoot();
var classDeclaration = root.DescendantNodes().OfType<ClassDeclarationSyntax>().First();

Runtime (CoreCLR JIT compilation):

var method = typeof(Program).GetMethod("Main");
var nativeCode = RuntimeHelpers.PrepareMethod(method.MethodHandle);

Summary

While Roslyn focuses on compiler and language services, providing powerful tools for code analysis and manipulation, runtime offers a broader scope encompassing the entire .NET execution environment. Roslyn's specialized nature makes it more accessible for language-specific contributions, but it may have a steeper learning curve. Runtime, on the other hand, covers a wider range of functionality but may be more complex to navigate for newcomers.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

.NET Runtime

Build Status Help Wanted Good First Issue Gitter Discord

This repo contains the code to build the .NET runtime, libraries and shared host (dotnet) installers for all supported platforms, as well as the sources to .NET runtime and libraries.

What is .NET?

Official Starting Page: https://dotnet.microsoft.com

How can I contribute?

We welcome contributions! Many people all over the world have helped make this project better.

Reporting security issues and security bugs

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter. You can also find these instructions in this repo's Security doc.

Also see info about related Microsoft .NET Bounty Program.

Filing issues

This repo should contain issues that are tied to the runtime, the class libraries and frameworks, the installation of the dotnet binary (sometimes known as the muxer) and the installation of the .NET runtime and libraries.

For other issues, please file them to their appropriate sibling repos. We have links to many of them on our new issue page.

Useful Links

.NET Foundation

.NET Runtime is a .NET Foundation project.

There are many .NET related projects on GitHub.

  • .NET home repo - links to 100s of .NET projects, from Microsoft and the community.
  • ASP.NET Core home - the best place to start learning about ASP.NET Core.

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.

General .NET OSS discussions: .NET Foundation Discussions

License

.NET (including the runtime repo) is licensed under the MIT license.