Table of Contents

Class AssemblyExtensions

Namespace
Xunit.Internal

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

string

Methods

GetLocalCodeBase(Assembly?)

public static string? GetLocalCodeBase(this Assembly? assembly)

Parameters

assembly Assembly

Returns

string

GetLocalCodeBase(string?, char)

public static string? GetLocalCodeBase(string? codeBase, char directorySeparator)

Parameters

codeBase string
directorySeparator char

Returns

string

GetSafeCodeBase(Assembly?)

Safely gets the code base of an assembly.

public static string? GetSafeCodeBase(this Assembly? assembly)

Parameters

assembly Assembly

The 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

assembly Assembly

The 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

assembly Assembly

The 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".