Skip to content

NuGetDepsJsonResolver

Namespace: Dotsider.Core.Analysis

Assembly: Dotsider.Core.dll

Resolves assembly references by consulting the referencing assembly’s .deps.json file to locate its NuGet dependencies in the NuGet global packages folder. This is the probe step that makes library projects work — dotnet build does not copy NuGet package assemblies next to a library’s bin output, but the .deps.json manifest records the exact resolved package version and runtime asset path, matching what the .NET host uses at runtime. Manifest paths are treated as untrusted and must remain inside the selected package in the configured global packages folder.

public static class NuGetDepsJsonResolver

ObjectNuGetDepsJsonResolver

Attempts to locate assemblyName in the referencing assembly’s .deps.json manifest and resolve it against the NuGet global packages folder.

Parameters:

  • referencingAssemblyPath (String): Path of the assembly whose .deps.json is consulted.
  • assemblyName (String): Simple name of the assembly to locate (e.g. Newtonsoft.Json).

Returns: ResolvedAssembly

A FromFile pointing at a contained packaged DLL, or null when the dependency is absent or its manifest path is unsafe.

public static ResolvedAssembly? TryResolve(string referencingAssemblyPath, string assemblyName)