Class AssemblyExtensions
INTERNAL CLASS. DO NOT USE.
public static class AssemblyExtensions
- Inheritance
-
AssemblyExtensions
- Inherited Members
Fields
UnknownTargetFramework
Gets the value for an unknown target framework.
public const string UnknownTargetFramework = "UnknownTargetFramework"
Field Value
Methods
GetLocalCodeBase(Assembly?)
public static string? GetLocalCodeBase(this Assembly? assembly)
Parameters
assemblyAssembly
Returns
GetLocalCodeBase(string?, char)
public static string? GetLocalCodeBase(string? codeBase, char directorySeparator)
Parameters
Returns
GetSafeCodeBase(Assembly?)
Safely gets the code base of an assembly.
public static string? GetSafeCodeBase(this Assembly? assembly)
Parameters
assemblyAssemblyThe assembly.
Returns
- string
If the assembly is null, or is dynamic, then it returns
null; otherwise, it returns the value from CodeBase.
GetSafeLocation(Assembly?)
Safely gets the location of an assembly.
public static string? GetSafeLocation(this Assembly? assembly)
Parameters
assemblyAssemblyThe assembly.
Returns
- string
If the assembly is null, or is dynamic, then it returns
null; otherwise, it returns the value from Location.
GetTargetFramework(Assembly)
Gets the target framework name for the given assembly.
public static string GetTargetFramework(this Assembly assembly)
Parameters
assemblyAssemblyThe assembly.
Returns
- string
The target framework (typically in a format like ".NETFramework,Version=v4.7.2" or ".NETCoreApp,Version=v6.0"). If the target framework type is unknown (missing file, missing attribute, etc.) then returns "UnknownTargetFramework".