AssemblyLoader.LoadReferencedAssembly Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| LoadReferencedAssembly(String, QsCompilation, Action<Exception>) |
Loads the Q# data structures in a referenced assembly with the path |
| LoadReferencedAssembly(Uri, References+Headers, Boolean, Action<Exception>) |
Loads the Q# data structures in a referenced assembly with the URI |
LoadReferencedAssembly(String, QsCompilation, Action<Exception>)
Loads the Q# data structures in a referenced assembly with the path asmPath,
and returns the loaded content as compilation.
public static bool LoadReferencedAssembly (string asmPath, out Microsoft.Quantum.QsCompiler.SyntaxTree.QsCompilation? compilation, Action<Exception>? onException = default);
static member LoadReferencedAssembly : string * QsCompilation * Action<Exception> -> bool
Public Function LoadReferencedAssembly (asmPath As String, ByRef compilation As QsCompilation, Optional onException As Action(Of Exception) = Nothing) As Boolean
Parameters
- asmPath
- String
- compilation
- QsCompilation
Returns
False if some of the content could not be loaded successfully, possibly because the referenced assembly has been compiled with an older compiler version.
Exceptions
asmPath does not exist.
Remarks
Catches any exception throw upon loading the compilation, and invokes onException with it if specified.
Sets compilation to null if an exception occurred during loading.
Applies to
LoadReferencedAssembly(Uri, References+Headers, Boolean, Action<Exception>)
Loads the Q# data structures in a referenced assembly with the URI asm,
and returns the loaded content via headers.
public static bool LoadReferencedAssembly (Uri asm, out Microsoft.Quantum.QsCompiler.CompilationBuilder.References.Headers headers, bool ignoreDllResources = false, Action<Exception>? onDeserializationException = default);
static member LoadReferencedAssembly : Uri * Headers * bool * Action<Exception> -> bool
Public Function LoadReferencedAssembly (asm As Uri, ByRef headers As References.Headers, Optional ignoreDllResources As Boolean = false, Optional onDeserializationException As Action(Of Exception) = Nothing) As Boolean
Parameters
- asm
- Uri
The uri of the referenced assembly.
- headers
- References.Headers
- ignoreDllResources
- Boolean
Called if an exception is thrown during deserialization.
Returns
False if some of the content could not be loaded successfully, possibly because the referenced assembly has been compiled with an older compiler version.
Exceptions
asm does not exist.
asm is not an absolute file URI.
Remarks
Throws the corresponding exceptions if the information cannot be extracted.