Marco
Marco

Reputation: 2235

Getting the path for .NET Core runtime Dlls

I inspect .NET dlls with the MetaLoadContext, introduced in .NET core 3.0.

Since the MetaLoadContext needs an assembly resolver (e.g. the provided PathAssemblyResolver) , I want to create an own one which has the strategy that it loads the .NET runtime DLL (e.g. netstandard.dll) from the SDK installation path. The issue is how can I get programmatically the SDK installation path with the runtime DLLs ?

Upvotes: 1

Views: 608

Answers (1)

Marco
Marco

Reputation: 2235

To get the path of the runtime .NET core DLLs call

System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()

Upvotes: 3

Related Questions