Work on this project can be tracked and discussed via the official issue in dotnet/runtime
. The P/Invoke source generator proposal contains additional details.
The Demo project is designed to be immediately consumable by everyone. It demonstrates a simple use case where the marshalling code is generated and a native function call with only blittable types is made. The project is configured to output the generated source to disk; the files can be found in the project's intermediate directory (obj/<Configuration>/<TargetFramework>/generated
). A managed assembly with native exports is used in the P/Invoke scenario.
- Step into the
Demo
application and observe the generated code for theSum
functions. - Find the implementation of the
sumrefi
function and set a breakpoint. Run the debugger and explore the stack. - Add a new export in the
NativeExports
project and update theDemo
application to call the new export. - Try the above scenarios when building in
Debug
orRelease
. Consider the differences.
This repo consumes new APIs from dotnet/runtime
and is configured to build against a custom runtime version. Either globally install the .NET runtime version specified by the MicrosoftNETCoreAppVersion
property or run build.cmd/sh
to have the Arcade infrastructure populate the .dotnet
folder with the matching runtime version.
All features of the dotnet
command line tool are supported for the respective project types (e.g. build
, run
, test
). A consistent cross-platform inner dev loop with an IDE is available using Visual Studio Code when appropriate .NET extensions are loaded.
On Windows, loading the solution in Visual Studio 2019 or later will enable the edit, build, debug inner dev loop. All features of Visual Studio are expected to operate correctly (e.g. Debugger, Test runner, Profiler).
Most of the above options have official tutorials. It is an aim of this project to follow canonical workflows that are intuitive to all developers.
This project has no explicit native build system and should remain that way. The DNNE
project is used to create native exports that can be called from the P/Invokes during testing.
.NET Runtime is a .NET Foundation project.
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.
.NET (including the runtime repo) is licensed under the MIT license.