files-community/Files

Code Quality: Replace references to Vanara and WinForms with CsWin32

Geschlossen

#15.000 geöffnet am 19.03.2024

 (11 Kommentare) (5 Reaktionen) (0 zugewiesene Personen)C# (2.719 Forks)batch import
help wanted

Repository-Metriken

Stars
 (43.502 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 11T 15h) (61 gemergte PRs in 30 T)

Beschreibung

Description

We're working on utilizing Native Aot in the application, however, runtime marshaler is one of the blocker against this. Vanara uses loads of runtime marshaler via DllImport and ComImport and we're working on replacing it with CsWin32, ultimately removing its reference completely.

Concerned code

  • Vanara references
  • DllImport we explicitly use within the codebase

Gains

  • AoT compliant codebase
  • Less 3rd party references

Requirements

  • Replace DllImport with CsWin32

Comments

CsWin32 requires you to add interfaces, functions, constants, enums, snd etc in NativeMethods.txt placed in Files.App.CsWin32. #define'd constants also need to be written in that text file and use like "PInvoke.CMF_DEFAULT" (They don't get placed in a particular namespace). For more info, download ILSpy and win32metadata.winmd in order to see the full projections.

Contributor Guide