Skip to content

DotNetRuntimeLocator

Namespace: Dotsider.Core.Analysis

Assembly: Dotsider.Core.dll

Discovers system .NET installations and resolves shared framework assembly paths.

public static class DotNetRuntimeLocator

Object → DotNetRuntimeLocator

FindAssemblyInSharedFramework(string, string?, string?)

Section titled “FindAssemblyInSharedFramework(string, string?, string?)”

Finds an assembly in the system .NET shared framework installation, matching the closest runtime version to the target framework.

Parameters:

  • assemblyName (String): Assembly name without extension (e.g. “System.Runtime”).
  • targetFramework (String): Target framework moniker (e.g. “.NETCoreApp,Version=v10.0”). Used for version matching.
  • preferredRuntimePack (String): If specified, this runtime pack is probed first (e.g. “Microsoft.AspNetCore.App”).

Returns: FrameworkAssemblyInfo

The resolved assembly info including the winning runtime pack, or null if not found.

public static FrameworkAssemblyInfo? FindAssemblyInSharedFramework(string assemblyName, string? targetFramework, string? preferredRuntimePack = null)