Community
    • Login

    C# Plugin for ARM64

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    1 Posts 1 Posters 32 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Guido ThelenG
      Guido Thelen
      last edited by Guido Thelen

      Hello,

      The situation

      My Plugin SQLinForm (SQL Formatter) is written in C# and is available for x86 and x64. It thanksfully uses the template NotepadPlusPlusPluginPack.Net from Kasper B. Graversen (kbilsted).
      Now I was able to produce a ARM64 based Version for the Plugin ( https://www.sqlinform.com/download-free-notepad-plugin/ ). But it needs as a prereq that the user has .net8 installed. Unlike .NET Framework 4.8, it is not automatically available with Windows11. I have 2 options:

      • include .net 8 in a “self-contained zip” but this would increase the size of the zip file up to 50 MB which is huge for a plugin.
      • require as pre-req to install .net8.

      My question

      I wonder how to publish the ARM64 plugin:

      • publish a Plugin for N++ and to add as a prereq that .net8 is to be installed
      • or should i produce a self-contained zip conatint .net 8 runtime with around 50 MB size?
      • or should I just allow to install it manually?

      More Details about the migration to ARM64

      Building ARM64 Notepad++ Plugins in C# with DNNE

      The Problem

      The classic approach for building Notepad++ plugins in C# relies on NppPlugin.DllExport (or the older UnmanagedExports by Robert Giesecke) to generate native exports from a .NET Framework assembly. These tools only support x86 and x64 — there is no ARM64 support, and .NET Framework itself doesn’t run on ARM64.
      With Windows on ARM becoming mainstream (Snapdragon X, Apple Silicon via Parallels), Notepad++ now ships an ARM64 build — but the existing C# plugin ecosystem can’t follow.

      The Solution

      DNNE (Dot-Net Native Exports) is a modern NuGet package that generates a native C wrapper DLL around your .NET 8 assembly. It uses [UnmanagedCallersOnly] attributes to define exports and supports ARM64 natively.

      The architecture becomes:

      Notepad++ (ARM64)
      ↓ LoadLibrary
      SQLinFormNpp.dll ← Native C wrapper (generated by DNNE)
      ↓ loads .NET runtime
      SQLinFormNppLib.dll ← managed C# code

      1 Reply Last reply Reply Quote 1
      • First post
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors