Vixen
02b45cc4
csharp
public static class NativeSearch

Where a native library is looked for, and in what order.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The application's own files first, the system last. A published game ships its natives in runtimes/<rid>/native/ — the layout NuGet produces and dotnet publish preserves — and those are the versions it was built and tested against. Asking the operating system first would mean a machine with an older system-wide copy of the same library silently wins, which is the shape of every "works on my machine" report ever filed about native dependencies.

Every path is produced before any file is touched. The whole of this class is a pure function from a name to a list of candidates, which is what makes the ordering testable without a filesystem, on a machine that is not the target platform.

Fields and properties (2)

  • public const string RuntimesFolder

    Where a published application keeps the natives it shipped with.

  • public const string NativeFolder

    The subdirectory under a runtime identifier that holds the binaries.

Methods (2)

  • public static IEnumerable<string> Directories(string baseDirectory, IReadOnlyList<string> ridChain, params ReadOnlySpan<string> extra)

    Every directory a native library may be in, most specific first.

  • public static IEnumerable<string> Paths(IEnumerable<string> directories, IEnumerable<string> fileNames)

    Every full path to try, in order.

Used by (2)

  • NativeLibrariesVixen.Platform.Native
  • NativeResolutionTestsVixen.Platform.Native.Tests