Click or drag to resize

ScriptOptions Class



Options for creating and running scripts.
Inheritance Hierarchy
SystemObject
  Microsoft.CodeAnalysis.ScriptingScriptOptions

Namespace:  Microsoft.CodeAnalysis.Scripting
Assembly:  Microsoft.CodeAnalysis.Scripting (in Microsoft.CodeAnalysis.Scripting.dll) Version: 2.3.0-dev-56735-00. Commit Hash: <developer build>
Syntax
public sealed class ScriptOptions

The ScriptOptions type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberDefault
Public propertyEmitDebugInformation
Specifies whether debugging symbols should be emitted.
Public propertyFileEncoding
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
Public propertyFilePath
The path to the script source if it originated from a file, empty otherwise.
Public propertyImports
The namespaces, static classes and aliases imported by the script.
Public propertyMetadataReferences
An array of MetadataReferences to be added to the script.
Public propertyMetadataResolver
MetadataReferenceResolver to be used to resolve missing dependencies, unresolved metadata references and #r directives.
Public propertySourceResolver
SourceReferenceResolver to be used to resolve source of scripts referenced via #load directive.
Top
Methods
  NameDescription
Public methodAddImports(IEnumerableT)
Public methodAddImports(String)
Creates a new ScriptOptions with Imports added.
Public methodAddReferences(IEnumerableT)
Public methodAddReferences(Assembly)
Creates a new ScriptOptions with references added.
Public methodAddReferences(String)
Creates a new ScriptOptions with references added.
Public methodAddReferences(MetadataReference)
Creates a new ScriptOptions with references added.
Public methodWithEmitDebugInformation
Creates a new ScriptOptions with debugging information enabled.
Public methodWithFileEncoding
Creates a new ScriptOptions with specified FileEncoding.
Public methodWithFilePath
Creates a new ScriptOptions with the FilePath changed.
Public methodWithImports(IEnumerableT)
Public methodWithImports(String)
Creates a new ScriptOptions with the Imports changed.
Public methodWithMetadataResolver
Creates a new ScriptOptions with specified MetadataResolver.
Public methodWithReferences(IEnumerableT)
Public methodWithReferences(Assembly)
Creates a new ScriptOptions with the references changed.
Public methodWithReferences(String)
Creates a new ScriptOptions with the references changed.
Public methodWithReferences(MetadataReference)
Creates a new ScriptOptions with the references changed.
Public methodWithSourceResolver
Creates a new ScriptOptions with specified SourceResolver.
Top
See Also