Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​AppContext

Assembly: System.Runtime

Inheritance: object → AppContext

Provides members for setting and retrieving data about an application's context.

Properties

public static string
BaseDirectory
Gets the file path of the base directory that the assembly resolver uses to probe for assemblies.
public static string
TargetFrameworkName
Gets the name of the framework version targeted by the current application.

Methods

public static object
GetData​(string name)
Returns the value of the named data element assigned to the current application domain.
Returns The value of <paramref name="name" /> , if <paramref name="name" /> identifies a named value; otherwise, <see langword="null" /> .
name The name of the data element.
public static void
SetData​(string name, object data)
Sets the value of the named data element assigned to the current application domain.
name The name of the data element
data The value of <paramref name="name" />
public static void
SetSwitch​(string switchName, bool isEnabled)
Sets the value of a switch.
switchName The name of the switch.
isEnabled The value of the switch.
public static bool
TryGetSwitch​(string switchName, Boolean& isEnabled)
public bool
Equals​(object obj)
Inherited from object
Determines whether the specified object is equal to the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
obj The object to compare with the current object.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public int
GetHashCode​()
Inherited from object
Serves as the default hash function.
Returns A hash code for the current object.
public Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .
public string
ToString​()
Inherited from object
Returns a string that represents the current object.
Returns A string that represents the current object.