Thanks to visit codestin.com
Credit goes to github.com

Skip to content

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.

License

Notifications You must be signed in to change notification settings

dotnet/runtimelab

 
 

Repository files navigation

DllImport Generator

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.

Example

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.

Recommended scenarios:

  • Step into the Demo application and observe the generated code for the Sum 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 the Demo application to call the new export.
  • Try the above scenarios when building in Debug or Release. Consider the differences.

Designs

Workflow

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.

Testing assets

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 Foundation

.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.

License

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

About

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published