Microsoft.CodeAnalysis.Scripting An exception thrown when the compilation stage of interactive execution produces compilation errors. The list of diagnostics produced by compilation. The result of loading an assembly reference to the interactive session. True if the assembly was loaded by the assembly loader, false if has been loaded before. Full path to the physical assembly file (might be a shadow-copy of the original assembly file). Original assembly file path. Implements an assembly loader for interactive compiler and REPL. The class is thread-safe. The original path of the assembly before it was shadow-copied. For GAC'd assemblies, this is equal to Assembly.Location no matter what path was used to load them. Notifies the assembly loader about a dependency that might be loaded in future. Assembly identity. Assembly location. Associates a full assembly name with its location. The association is used when an assembly is being loaded and its name needs to be resolved to a location. is null. is not an existing path. Notifies the assembly loader about an in-memory dependency that should be available within the resolution context. Assembly identity. is null. When another in-memory assembly references the the loader responds with the specified dependency if the assembly identity matches the requested one. Represents a shadow copy of an assembly or a standalone module. Assembly manifest module copy or a standalone module copy. Documentation file copy or null if there is none. Documentation files are currently only supported for manifest modules, not modules included in an assembly. Implements shadow-copying metadata file cache. Creates an instance of . The directory to use to store file copies. Directories to exclude from shadow-copying. Culture of documentation comments to copy. If not specified no doc comment files are going to be copied. is null. is not an absolute path. Determine whether given path is under the shadow-copy directory managed by this shadow-copy provider. Absolute path. is null. is not an absolute path. Clears shadow-copy cache, disposes all allocated metadata, and attempts to delete copied files. Gets or creates metadata for specified file path. Full path to an assembly manifest module file or a standalone module file. Metadata kind (assembly or module). Metadata for the specified file. Error reading file . See for details. Gets or creates a copy of specified assembly or standalone module. Full path to an assembly manifest module file or a standalone module file. Metadata kind (assembly or module). Copy of the specified file, or null if the file doesn't need a copy (). Returns the same object if called multiple times with the same path. is null. is not an absolute path. Error reading file . See for details. Suppresses shadow-copying of specified path. Full path. is null. is not an absolute path. Doesn't affect files that have already been shadow-copied. Determines whether given file is a candidate for shadow-copy. An absolute path. True if the shadow-copy policy applies to the specified path. is null. is not absolute. Represents a shadow copy of a single file. csi.exe and vbi.exe entry point. csi.exe and vbi.exe entry point. Defines global members that common command line script hosts expose to the hosted scripts. It is recommended for hosts to expose the members defined by this class and implement the same semantics, so that they can run scripts written against standard hosts. Specialized hosts that target niche scenarios might choose to not provide this functionality. Arguments given to the script. Pretty-prints an object. Defines global members that common REPL (Read Eval Print Loop) hosts make available in the interactive session. It is recommended for hosts to expose the members defined by this class and implement the same semantics, so that they can run scripts written against standard hosts. Specialized hosts that target niche scenarios might choose to not provide this functionality. Arguments given to the script. Pretty-prints an object. Object pretty printer. Object pretty printer. Object pretty printer. This is for conveying cyclic dependencies to the user, not for detecting them. Internal for testing. Returns a method signature display string. Used to display stack frames. Null if the method is a compiler generated method that shouldn't be displayed to the user. Formats object members to a list. Inline == false: { A=true, B=false, C=new int[3] { 1, 2, 3 } } Inline == true: { A: true, B: false, C: new int[3] { 1, 2, 3 } } Enumerates sorted object members to display. Evaluate a format string with possible member references enclosed in braces. E.g. "goo = {GetGooString(),nq}, bar = {Bar}". Although in theory any expression is allowed to be embedded in the string such behavior is in practice fundamentally broken. The attribute doesn't specify what language (VB, C#, F#, etc.) to use to parse these expressions. Even if it did all languages would need to be able to evaluate each other language's expressions, which is not viable and the Expression Evaluator doesn't work that way today. Instead it evaluates the embedded expressions in the language of the current method frame. When consuming VB objects from C#, for example, the evaluation might fail due to language mismatch (evaluating VB expression using C# parser). Therefore we limit the expressions to a simple language independent syntax: {clr-member-name} '(' ')' ',nq', where parentheses and ,nq suffix (no-quotes) are optional and the name is an arbitrary CLR field, property, or method name. We then resolve the member by name using case-sensitive lookup first with fallback to case insensitive and evaluate it. If parentheses are present we only look for methods. Only parameterless members are considered. Doesn't (and doesn't need to) reflect the number of digits in since it's only used for a conservative approximation (shorter is more conservative when trying to determine the minimum number of members that will fill the output). String that describes "null" literal in the language. Returns null if the type is not considered primitive in the target language. Since is an extension point, we don't perform any validation on - it's up to the individual subtype. Formats an array type name (vector or multidimensional). Display structure of the object on a single line. Displays a simple description of the object followed by list of members. Each member is displayed on a separate line. Display just a simple description of the object, like type name or ToString(). Don't display any members of the object. does not apply this format to collections elements - they are shown regardless. Object pretty printer. Virtual so that extenders can support other radices. Provides basic REPL functionality. Syntax is "nuget:name[/version]". Resolves metadata references for scripts. Operates on runtime metadata artifacts. Creates a resolver that uses the current platform settings (GAC, platform assembly list). Resolves assembly identities in Global Assembly Cache. Returns true if GAC is available on the current platform. Architecture filter used when resolving assembly references. used when resolving assembly references, or null to prefer no culture. Creates an instance of a , if available on the platform (check ). Supported architectures used to filter GAC assemblies. A culture to use when choosing the best assembly from among the set filtered by The platform doesn't support GAC. A class that represents a script that you can run. Create a script using a language specific script class such as CSharpScript or VisualBasicScript. A script that will run first when this script is run. Any declarations made in the previous script can be referenced in this script. The end state from running this script includes all declarations made by both scripts. The options used by this script. The source code of the script. The of the script. The type of an object whose members can be accessed by the script as global variables. The expected return type of the script. Creates a new version of this script with the specified options. Continues the script with given code snippet. Continues the script with given representing code. Stream is null. Stream is not readable or seekable. Continues the script with given code snippet. Continues the script with given representing code. Stream is null. Stream is not readable or seekable. Get's the that represents the semantics of the script. Runs the script from the beginning and returns the result of the last code snippet. An instance of holding on values of global variables accessible from the script. Must be specified if and only if the script was created with a . Cancellation token. The result of the last code snippet. Runs the script from the beginning. An instance of holding on values for global variables accessible from the script. Must be specified if and only if the script was created with . Cancellation token. A that represents the state after running the script, including all declared variables and return value. Runs the script from the beginning. An instance of holding on values for global variables accessible from the script. Must be specified if and only if the script was created with . If specified, any exception thrown by the script top-level code is passed to . If it returns true the exception is caught and stored on the resulting , otherwise the exception is propagated to the caller. Cancellation token. A that represents the state after running the script, including all declared variables and return value. Run the script from the specified state. Previous state of the script execution. Cancellation token. A that represents the state after running the script, including all declared variables and return value. Run the script from the specified state. Previous state of the script execution. If specified, any exception thrown by the script top-level code is passed to . If it returns true the exception is caught and stored on the resulting , otherwise the exception is propagated to the caller. Cancellation token. A that represents the state after running the script, including all declared variables and return value. Forces the script through the compilation step. If not called directly, the compilation step will occur on the first call to Run. Gets the references that need to be assigned to the compilation. This can be different than the list of references defined by the instance. Compilation has errors. Compilation has errors. Compilation has errors. Runs the script from the beginning and returns the result of the last code snippet. An instance of holding on values of global variables accessible from the script. Must be specified if and only if the script was created with a . Cancellation token. The result of the last code snippet. Runs the script from the beginning. An instance of holding on values for global variables accessible from the script. Must be specified if and only if the script was created with . Cancellation token. A that represents the state after running the script, including all declared variables and return value. Compilation has errors. The type of doesn't match . Runs the script from the beginning. An instance of holding on values for global variables accessible from the script. Must be specified if and only if the script was created with . If specified, any exception thrown by the script top-level code is passed to . If it returns true the exception is caught and stored on the resulting , otherwise the exception is propagated to the caller. Cancellation token. A that represents the state after running the script, including all declared variables and return value. Compilation has errors. The type of doesn't match . Creates a delegate that will run this script from the beginning when invoked. The delegate doesn't hold on this script or its compilation. Run the script from the specified state. Previous state of the script execution. Cancellation token. A that represents the state after running the script, including all declared variables and return value. is null. is not a previous execution state of this script. Run the script from the specified state. Previous state of the script execution. If specified, any exception thrown by the script top-level code is passed to . If it returns true the exception is caught and stored on the resulting , otherwise the exception is propagated to the caller. Cancellation token. A that represents the state after running the script, including all declared variables and return value. is null. is not a previous execution state of this script. Represents a runtime execution context for scripts. Unique prefix for generated assemblies. The full names of uncollectible assemblies generated by this context must be unique, so that we can resolve references among them. Note that CLR can load two different assemblies of the very same identity into the same load context. We are using a certain naming scheme for the generated assemblies (a fixed name prefix followed by a number). If we allowed the compiled code to add references that match this exact pattern it might happen that the user supplied reference identity conflicts with the identity we use for our generated assemblies and the AppDomain assembly resolve event won't be able to correctly identify the target assembly. To avoid this problem we use a prefix for assemblies we generate that is unlikely to conflict with user specified references. We also check that no user provided references are allowed to be used in the compiled code and report an error ("reserved assembly name"). Compilation has errors. Builds a delegate that will execute just this scripts code. Represents the submission states and globals that get passed to a script entry point when run. Options for creating and running scripts. An array of s to be added to the script. The array may contain both resolved and unresolved references (). Unresolved references are resolved when the script is about to be executed (. Any resolution errors are reported at that point through . to be used to resolve missing dependencies, unresolved metadata references and #r directives. to be used to resolve source of scripts referenced via #load directive. The namespaces, static classes and aliases imported by the script. Specifies whether debugging symbols should be emitted. Specifies the encoding to be used when debugging scripts loaded from a file, or saved to a file for debugging purposes. If it's null, the compiler will attempt to detect the necessary encoding for debugging The path to the script source if it originated from a file, empty otherwise. Specifies whether or not optimizations should be performed on the output IL. Whether bounds checking on integer arithmetic is enforced by default or not. Allow unsafe regions (i.e. unsafe modifiers on members and unsafe blocks). Global warning level (from 0 to 4). Creates a new with the changed. Creates a new with the references changed. is null or contains a null reference. Creates a new with the references changed. is null or contains a null reference. Creates a new with the references changed. is null or contains a null reference. Creates a new with references added. is null or contains a null reference. Creates a new with references added. Creates a new with the references changed. is null or contains a null reference. Specified assembly is not supported (e.g. it's a dynamic assembly). Creates a new with the references changed. is null or contains a null reference. Specified assembly is not supported (e.g. it's a dynamic assembly). Creates a new with references added. is null or contains a null reference. Specified assembly is not supported (e.g. it's a dynamic assembly). Creates a new with references added. is null or contains a null reference. Specified assembly is not supported (e.g. it's a dynamic assembly). Creates a new with the references changed. is null or contains a null reference. Creates a new with the references changed. is null or contains a null reference. Creates a new with references added. is null or contains a null reference. Creates a new with references added. Creates a new with specified . Creates a new with specified . Creates a new with the changed. is null or contains a null reference. Creates a new with the changed. is null or contains a null reference. Creates a new with the changed. is null or contains a null reference. Creates a new with added. is null or contains a null reference. Creates a new with added. is null or contains a null reference. Creates a new with debugging information enabled. Creates a new with specified . Create a new with the specified . Create a new with unsafe code regions allowed. Create a new with bounds checking on integer arithmetic enforced. Create a new with the specific . A delegate that will run a script when invoked. An object instance whose members can be accessed by the script as global variables. Cancellation token. The type of doesn't match the corresponding . The result of running a script. The script that ran to produce this result. Caught exception originating from the script top-level code. Exceptions are only caught and stored here if the API returning the is instructed to do so. By default they are propagated to the caller of the API. The final value produced by running the script. Returns variables defined by the scripts in the declaration order. Returns a script variable of the specified name. If multiple script variables are defined in the script (in distinct submissions) returns the last one. Name lookup is case sensitive in C# scripts and case insensitive in VB scripts. or null, if no variable of the specified is defined in the script. is null. Continues script execution from the state represented by this instance by running the specified code snippet. The code to be executed. Options. Cancellation token. A that represents the state after running , including all declared variables and return value. Continues script execution from the state represented by this instance by running the specified code snippet. The code to be executed. Options. If specified, any exception thrown by the script top-level code is passed to . If it returns true the exception is caught and stored on the resulting , otherwise the exception is propagated to the caller. Cancellation token. A that represents the state after running , including all declared variables, return value and caught exception (if applicable). Continues script execution from the state represented by this instance by running the specified code snippet. The code to be executed. Options. Cancellation token. A that represents the state after running , including all declared variables and return value. Continues script execution from the state represented by this instance by running the specified code snippet. The code to be executed. Options. If specified, any exception thrown by the script top-level code is passed to . If it returns true the exception is caught and stored on the resulting , otherwise the exception is propagated to the caller. Cancellation token. A that represents the state after running , including all declared variables, return value and caught exception (if applicable). A variable declared by the script. The name of the variable. The type of the variable. True if the variable can't be written to (it's declared as readonly or a constant). The value of the variable after running the script. Variable is read-only or a constant. The type of the specified isn't assignable to the type of the variable. !<Stack overflow while evaluating object> Can't assign '{0}' to '{1}'. Expected an assembly reference. Display name or path cannot be empty. Absolute path expected The globals of type '{0}' is not assignable to '{1}' Starting state was incompatible with script. Invalid assembly name Invalid characters in assemblyName The script requires access to global variables but none were given Global variables passed to a script without a global type + additional {0} error + additional {0} errors at {0} : {1} Cannot set a read-only variable Cannot set a constant variable Type "#help" for more information. Keyboard shortcuts: Enter If the current submission appears to be complete, evaluate it. Otherwise, insert a new line. Escape Clear the current submission. UpArrow Replace the current submission with a previous submission. Dow ... Assembly '{0}, Version={1}' has already been loaded from '{2}'. A different assembly with the same name and version can't be loaded: '{3}'. Assembly '{0}' has already been loaded from '{1}'. A different assembly with the same name can't be loaded unless it's signed: '{2}'. Cannot set {0} specific option {1} because the options were already configured for a different language. Initializes a new instance of the class. An ordered set of fully qualified paths which are searched when resolving assembly names. Directory used when resolving relative paths. Provides APIs to enumerate and look up assemblies stored in the Global Assembly Cache. This resolver only works when running under the .net framework runtime. Enumerates assemblies in the GAC returning those that match given partial name and architecture. Optional partial name. Optional architecture filter. Enumerates assemblies in the GAC returning those that match given partial name and architecture. The optional partial name. The optional architecture filter. Enumerates assemblies in the GAC returning their simple names. Optional architecture filter. Unique simple names of GAC assemblies. Converts to with all metadata fields filled. Assembly name with Version, Culture and PublicKeyToken components filled in: "SimpleName, Version=#.#.#.#, Culture=XXX, PublicKeyToken=XXXXXXXXXXXXXXXX". In addition Retargetable flag and ContentType are set. Converts to an equivalent . Creates object by parsing given display name. Selects the candidate assembly with the largest version number. Uses culture as a tie-breaker if it is provided. All candidates are assumed to have the same name and must include versions and cultures. Provides APIs to enumerate and look up assemblies stored in the Global Assembly Cache. Represents the current Processor architecture. Enumerates assemblies in the GAC returning those that match given partial name and architecture. Optional partial name. Optional architecture filter. Enumerates assemblies in the GAC returning those that match given partial name and architecture. The optional partial name. The optional architecture filter. Enumerates assemblies in the GAC returning their simple names. Optional architecture filter. Unique simple names of GAC assemblies. Looks up specified partial assembly name in the GAC and returns the best matching . The display name of an assembly The optional processor architecture The optional preferred culture information An assembly identity or null, if can't be resolved. is null. Looks up specified partial assembly name in the GAC and returns the best matching . The display name of an assembly Full path name of the resolved assembly The optional processor architecture The optional preferred culture information An assembly identity or null, if can't be resolved. is null. Provides APIs to enumerate and look up assemblies stored in the Global Assembly Cache. Implements a no-op wrapper to search the global assembly cache when running under a .net core runtime. At some point we may wish to get information about assemblies in the GAC under a .net core runtime - for example if we're loading a .net framework project in vscode and want to find the actual assembly to decompile. However it isn't extremely straightforward to implement and we don't need it at this time so leaving it as a no-op. More info on how this might be possible under a .net core runtime can be found https://github.com/dotnet/core/issues/3048#issuecomment-725781811