AssemblyLoadContext to compile from syntax trees in memory and to load from disk/file. Provides dependency resolution. [IMPORTANT] Only supports 1 in-memory compiled assembly at a time. Use more instances if you need more. [IMPORTANT] All file assemblies required for the compilation of syntax trees should be loaded first.
More...
|
override Assembly | Load (AssemblyName assemblyName) |
|
AssemblyLoadContext to compile from syntax trees in memory and to load from disk/file. Provides dependency resolution. [IMPORTANT] Only supports 1 in-memory compiled assembly at a time. Use more instances if you need more. [IMPORTANT] All file assemblies required for the compilation of syntax trees should be loaded first.
◆ MemoryFileAssemblyContextLoader()
Barotrauma.MemoryFileAssemblyContextLoader.MemoryFileAssemblyContextLoader |
( |
AssemblyManager | assemblyManager | ) |
|
◆ CompileAndLoadScriptAssembly()
AssemblyLoadingSuccessState Barotrauma.MemoryFileAssemblyContextLoader.CompileAndLoadScriptAssembly |
( |
[NotNull] string | assemblyName, |
|
|
[NotNull] IEnumerable< SyntaxTree > | syntaxTrees, |
|
|
IEnumerable< MetadataReference > | externMetadataReferences, |
|
|
[NotNull] CSharpCompilationOptions | compilationOptions, |
|
|
out string | compilationMessages, |
|
|
IEnumerable< Assembly > | externFileAssemblyReferences = null ) |
Compiles the supplied syntaxtrees and options into an in-memory assembly image. Builds metadata from loaded assemblies, only supply your own if you have in-memory images not managed by the AssemblyManager class.
- Parameters
-
assemblyName | Name of the assembly. Must be supplied for in-memory assemblies. |
syntaxTrees | Syntax trees to compile into the assembly. |
externMetadataReferences | Metadata to be used for compilation. [IMPORTANT] This method builds metadata from loaded assemblies, only supply your own if you have in-memory images not managed by the AssemblyManager class. |
compilationOptions | CSharp compilation options. This method automatically adds the 'IgnoreAccessChecks' property for compilation. |
compilationMessages | Will contain any diagnostic messages for compilation failure. |
externFileAssemblyReferences | Additional assemblies located in the FileSystem to build metadata references from. Assemblies here will have duplicates by the same name that are currently loaded filtered out. |
- Returns
- Success state of the operation.
- Exceptions
-
ArgumentNullException | Throws exception if any of the required arguments are null. |
◆ Load()
override Assembly Barotrauma.MemoryFileAssemblyContextLoader.Load |
( |
AssemblyName | assemblyName | ) |
|
|
protected |
◆ LoadFromFiles()
AssemblyLoadingSuccessState Barotrauma.MemoryFileAssemblyContextLoader.LoadFromFiles |
( |
[NotNull] IEnumerable< string > | assemblyFilePaths | ) |
|
Try to load the list of disk-file assemblies.
- Parameters
-
assemblyFilePaths | Operation success or failure reason. |
◆ IsResolving
bool Barotrauma.MemoryFileAssemblyContextLoader.IsResolving |
|
protected |
◆ CompiledAssembly
Assembly Barotrauma.MemoryFileAssemblyContextLoader.CompiledAssembly |
|
get |
◆ CompiledAssemblyImage
byte [] Barotrauma.MemoryFileAssemblyContextLoader.CompiledAssemblyImage |
|
get |
◆ FriendlyName
string Barotrauma.MemoryFileAssemblyContextLoader.FriendlyName |
|
getset |
◆ IsDisposed
bool Barotrauma.MemoryFileAssemblyContextLoader.IsDisposed |
|
get |
◆ IsTemplateMode
bool Barotrauma.MemoryFileAssemblyContextLoader.IsTemplateMode |
|
getset |
The documentation for this class was generated from the following file: