GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - UnixY2K/dotnet-native-lib: Example of how to build a .NET native library for another programs

This repository was archived by the owner on Mar 18, 2024. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
DotNetLib
DotNetLib
 
 
cpp
cpp
 
 
.clang-format
.clang-format
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
meson.build
meson.build
 
 

Repository files navigation

.NET Library for Native Apps

dotnet AOT support is now out, this project will be archived as it is now officially suported

Steps from scratch

  • Create a new project
    dotnet new classlib -o DotNetLib
  • add NativeAOT support by creating a nuget config
    cd DotNetLib
    dotnet new nugetconfig
  • Add the following to the nuget.config file:
    <add key="dotnet-experimental" value="https://pkgs.dev.azure.com/dnceng/public/  _packaging/dotnet-experimental/nuget/v3/index.json" />
  • add a reference to the compiler
    dotnet add package Microsoft.DotNet.ILCompiler -v 7.0.0-*
  • then you can publish the dll like this
    dotnet publish /p:NativeLib=Shared /p:SelfContained=true -r <RID> -c <Configuration>

Cpp steps

  • make and build the native executable
    meson builddir
    meson compile -C builddir
  • put the library in the executable generated by meson (buiddir/cpp)
  • run it
    ./builddir/bin/<executable>

About

Example of how to build a .NET native library for another programs

Resources

Readme
BSD-3-Clause license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.