Giter VIP home page Giter VIP logo

nxports's Introduction

NXPorts

CI NuGet Gallery Release

A MSBuild-integrated library/tool to expose entrypoints in .NET assemblies to the platform invocation system or short PInvoke. It allows you to build .NET libraries that can be called from any development platform that supports PInvoke, including C++, C, Rust, Delphi, Python and so on...

Getting Started

To get started you only have to add the NXPorts package to your project. That's it. NXPorts will automatically generate exports as part of your build now. Some samples are available here.

Prerequisites

This software itself will run on any system that supports developing .NET software - it does not have any dependencies on ildasm.exe, ilasm.exe or any other windows-only libraries.

Keep in mind that Reverse PInvoke - calling PInvoke entrypoints in .NET assemblies - is only officially supported in the .NET Framework. It may work in other runtimes as well, but your mileage may vary.

See Compatibility Docs for more info.

Sample

The following code will result in an exported function named SampleExportFunc.

public static class Exports {
  [DllExport(alias:"SampleExportFunc")]
  public static double Add(double a, double b)
  {
      return a + b;
  }
}

Building from Source

To build packages by yourself all you have to do is the dotnet cli like this:

  dotnet pack

This will restore, build and pack all available projects. Testing this project is just as simple:

  dotnet test

More information about the release process can be found here.

Contributing

I am more than happy to take in PRs. Documentation regarding Marshalling, PE32 or PInvoke (especially on non-NETFX runtimes) counts just as much as a valuable contribution as any other code PR.

To me writing issues is also just as valuable. I may not list every issue reporter in the release notes, but especially during the initial development timeline knowing the shortcomings of the software is absolutely invaluable.

Guidelines

  • Please consider writing an issue first
  • Please target PRs towards the master branch

nxports's People

Contributors

dependabot[bot] avatar filmor avatar meiktranel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.