/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Workspaces/MSBuild/Contracts/IBuildHost.cs
61 строка
3 KB
Jan Jones
Allow MSBuildWorkspace to open file-based apps (#84139)
30 июл 2026, 11:03
Не верифицирован
30 июл 2026, 11:03
7e7ebef
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace Microsoft.CodeAnalysis.MSBuild; /// <summary> /// RPC methods. /// </summary> internal interface IBuildHost { /// <summary> /// Finds the best MSBuild instance installed for loading the given project or solution. /// </summary> /// <remarks> /// This may return MSBuild instances that are not loadable by the BuildHost process. /// </remarks> MSBuildLocation? FindBestMSBuild(string projectOrSolutionFilePath); /// <summary> /// Determines whether there is a MSBuild instance that is loadable by the BuildHost process. /// </summary> /// <remarks> /// This may return true even if the project or solution require a newer version of MSBuild. /// </remarks> bool HasUsableMSBuild(string projectOrSolutionFilePath); /// <summary> /// Called once on a new process to configure some global state. This is used for these rather than passing through command line strings, since these contain data that might /// contain paths (which can have escaping issues) or could be quite large (which could run into length limits). /// </summary> /// <param name="knownCommandLineParserLanguages">Languages whose command line parser we understand (ICommandLineParserService).</param> /// <param name="maxNodeCount">The maximum number of MSBuild nodes that may build concurrently, or <see langword="null"/> to use MSBuild's default. Builds submitted in parallel can run in parallel up to this limit.</param> void ConfigureGlobalState(string[] knownCommandLineParserLanguages, Dictionary<string, string> globalProperties, string? binlogPath, int? maxNodeCount); Task<int> LoadProjectFileAsync(string projectFilePath, string languageName, CancellationToken cancellationToken); /// <summary> /// Permits loading a project file which only exists in-memory, for example, for file-based program scenarios. /// </summary> /// <param name="projectFilePath">A path to a project file which may or may not exist on disk. Note that an extension that is known by MSBuild, such as .csproj or .vbproj, should be used here.</param> /// <param name="physicalFilePath">The original C# file path.</param> /// <param name="projectContent">The project file XML content.</param> /// <returns>A handle to the loaded project (<see cref="IProjectFile"/>).</returns> int LoadProject(string projectFilePath, string? physicalFilePath, string projectContent, string languageName, IDictionary<string, string>? globalProperties); /// <summary> /// Permits loading a project instance which only exists in-memory, for example, for file-based program scenarios. /// </summary> /// <param name="projectFilePath">A path to a project file which may or may not exist on disk.</param> /// <param name="projectContent">The project file XML content.</param> /// <returns>A handle to the loaded project instance (<see cref="IProjectInstance"/>).</returns> int LoadProjectInstance(string projectFilePath, string projectContent, IDictionary<string, string>? additionalGlobalProperties); Task<string?> TryGetProjectOutputPathAsync(string projectFilePath, CancellationToken cancellationToken); Task ShutdownAsync(); }