Files
SharpIDE/src/SharpIDE.Application/Features/Evaluation/ProjectEvaluation.cs
Matt Parker e2bf045025 rename
2025-08-11 19:32:49 +10:00

21 lines
689 B
C#

using Ardalis.GuardClauses;
using Microsoft.Build.Evaluation;
namespace SharpIDE.Application.Features.Evaluation;
public static class ProjectEvaluation
{
private static readonly ProjectCollection _projectCollection = ProjectCollection.GlobalProjectCollection;
public static async Task<Project> GetProject(string projectFilePath)
{
Guard.Against.Null(projectFilePath, nameof(projectFilePath));
await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
var project = _projectCollection.LoadProject(projectFilePath);
Console.WriteLine($"Project loaded: {project.FullPath}");
//var outputType = project.GetProperty("OutputType");
return project;
}
}