Loic.MichalStrehovsky.zerosharp 1.0.0

dotnet add package Loic.MichalStrehovsky.zerosharp --version 1.0.0
                    
NuGet\Install-Package Loic.MichalStrehovsky.zerosharp -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Loic.MichalStrehovsky.zerosharp" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Loic.MichalStrehovsky.zerosharp" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Loic.MichalStrehovsky.zerosharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Loic.MichalStrehovsky.zerosharp --version 1.0.0
                    
#r "nuget: Loic.MichalStrehovsky.zerosharp, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Loic.MichalStrehovsky.zerosharp@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Loic.MichalStrehovsky.zerosharp&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Loic.MichalStrehovsky.zerosharp&version=1.0.0
                    
Install as a Cake Tool

C# for systems programming

These samples show how to compile C# to native code using the .NET Native AOT technology (NativeAOT, also known as CoreRT previously).

no-runtime is a rather pointless sample that demonstrates how to write code in C# that is directly runnable without a runtime. C# has value types and you can p/invoke into an unmanaged memory allocator, so you can do things with this, but you're so severily limited it's rather pointless. But Hello world ends up being about 4-5 kB native EXE, so that's rather cool.

with-runtime is something that can be actually useful. This includes the full managed and unmanaged runtime - GC, exception handling, and interface dispatch all work. Test.CoreLib used as the class library here is the same Test.CoreLib that you can find in the NativeAOT repo. Don't look for things like Object.ToString() because being compatible with .NET is not the point. This sample comes down to about 400 kB, most of which is the C runtime library.

efi-no-runtime is an EFI boot application that lets you run C# on bare metal, without an OS. Similar restrictions to the no-runtime sample apply. Making a version of this sample with a runtime would require some porting work on the runtime side.

Building the samples

There are some prerequisites for running the build scripts:

  • A NativeAOT drop
  • Visual Studio 2019 with C++ support and a Windows SDK

You can run these without building NativeAOT yourself. Just point the DROPPATH environment variable to the ILCompiler package in your NuGet package cache (if you ever played with using NativeAOT, it will be somewhere like C:\Users\{user}\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\6.0.0-alpha.1.21055.3). If you haven't tried NativeAOT for your normal .NET Core projects yet, go try it out, it's cool.

The build.cmd script needs to be executed from a "x64 Native Tools Command Prompt for VS 2019" - it's in your Start menu. Also make sure DROPPATH is set as above.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 7/31/2021