百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

DllExport

> 编程语言
开源

带有 .NET Core 支持的 .NET DllExport (又名 3F/DllExport 或者 DllExport.bat)

1.1K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

带有 .NET Core 支持的 .NET DllExport (又名 3F/DllExport 或者 DllExport.bat)

.NET DllExport

.NET DllExport with .NET Core support (aka 3F/DllExport aka DllExport.bat) DllExport-help | gntDllExport

[DllExport("Init", CallingConvention.Cdecl)]
[DllExport(CallingConvention.StdCall)]
// Cdecl is the default calling convention in .NET DllExport
[DllExport("MyFunc")]
[DllExport]

Based on UnmanagedExports that was created by Robert Giesecke. His page.

.NET DllExport is a different project that was developed by Denis Kuzmin 「 ☕ 」

Copyright (c) 2009-2015  Robert Giesecke
Copyright (c) 2016-2025  Denis Kuzmin  github/3F

[ Quick start ] [ Examples: C++, C#, Java, ... ] -> { Wiki } { Demo } Example of using DllExport + Conari:

[⏯]

[DllExport] // DllExportModifiedClassLibrary.dll
public static IntPtr callme(TCharPtr str, IntPtr structure)
{
    if(str != "Hello world!") return IntPtr.Zero;

    structure.Native().f("x", "y").build(out dynamic v);
    if(v.x > v.y)
    {
        structure.Access().write(8);
    }
    return new NativeArray(-1, v.x, 1, v.y);
}

[⏯]

... // host side via C/C++, Java, Rust, Python, ... or even same dotnet C#
using NativeString ns = new("Hello world!");
using NativeStruct nstruct = new(new Arg() { x = 7, y = 5 });

using dynamic l = new ConariX("DllExportModifiedClassLibrary.dll");
IntPtr ptr = l.callme(ns, nstruct);

using NativeArray nr = new(4, ptr); // (nstruct.Data.x == 8) != (nr[1] == 7)

For Lua, consider using LuNari

[DllExport]
public static int entrypoint(IntPtr L)
{
    using Lua lua = new("Lua.dll");
    ...
    lua.pushcclosure(L, onProc, 0);
    lua.setglobal(L, "onKeyDown");
    LuaNumber num = lua.tonumber(L, 7);
    ...
}

.NET DllExport supports both Library (.dll) and Executable (.exe) PE modules.

How does it work

Current features has been implemented through ILDasm & ILAsm that prepares all the necessary steps via .export directive (it's part of the ILAsm compiler, not CLR).

What inside ? how does work the .export directive ?

Read about format PE32/PE32+, start with grammar from asmparse and move to writer:

…

Read also my brief explanations here: AssemblyRef encoding / about mscoree / DllMain & the export-table / DllExport.dll / ordinals ...

How to get DllExport

Does DllExport support NuGet ?

Most likely yes. But NuGet features are not guaranteed (tl;dr something may not work or not work properly)

Use directly latest stable DllExport.bat (~28 KB). Read Wiki

  • Get it from GitHub Releases. Or link to latest stable: https://3F.github.io/DllExport/releases/latest/manager/
  • Or from Visual Studio Package Manager can still distribute and activate DllExport.bat for solution folder in most default setup cases.
  • Or use embeddable package manager GetNuTool

Read [ Documentation ]

Build .NET DllExport from source

git clone https://github.com/3F/DllExport.git DllExport
cd DllExport

Call build.bat to build final binaries like DllExport..nupkg, Manager, tests, zip-archives, and related:

.\build Release

Note, this relies on vsSolutionBuildEvent scripting if you're using Visual Studio IDE.

Modified IL Assembler

We're using 3F's modified versions specially for .NET DllExport project

  • https://github.com/3F/coreclr

This helps to avoid some problems like this, or this, and more ...

To build minimal version:

.\build # ilasm -x64

Make sure you have installed CMake before build.

To build assembler and use exactly this compiled version with DllExport, command like:

.\build # ilasm -x64 & .\build Release

Alternatively you can get official compiled versions via

Or like:

.tools\gnt ILAsm & .\build Release

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#conaricoreclrcoreclr-ilasmdllexport

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言