ProjectManager.LoadProjectReferences 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.
Load project references.
public static System.Collections.Immutable.ImmutableDictionary<string,Microsoft.Quantum.QsCompiler.CompilationBuilder.References.Headers> LoadProjectReferences (System.Collections.Generic.IEnumerable<string> refProjectFiles, Func<Uri,Uri?> getOutputPath, Action<Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic>? onDiagnostic = default, Action<Exception>? onException = default);
static member LoadProjectReferences : seq<string> * Func<Uri, Uri> * Action<Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic> * Action<Exception> -> System.Collections.Immutable.ImmutableDictionary<string, Microsoft.Quantum.QsCompiler.CompilationBuilder.References.Headers>
Public Shared Function LoadProjectReferences (refProjectFiles As IEnumerable(Of String), getOutputPath As Func(Of Uri, Uri), Optional onDiagnostic As Action(Of Diagnostic) = Nothing, Optional onException As Action(Of Exception) = Nothing) As ImmutableDictionary(Of String, References.Headers)
Parameters
- refProjectFiles
- IEnumerable<String>
- onDiagnostic
- Action<Diagnostic>
Called on all generated diagnostics.
Returns
A dictionary that maps each project file for which the corresponding dll content could be loaded to the Q# attributes it contains.
Remarks
Uses FilterFiles to filter refProjectFiles, and generates the corresponding errors and warnings.
For each existing project file, calls getOutputPath on it to obtain the path to the built dll for the project.
For any exception due to a failure of getOutputPath the onException is invoked. A failure of getOutputPath consists of it throwing an exception, or returning a path that does exist but not correspond to a valid dll.
If no file exists at the returned path, generates a suitable error message.