I'm building a .NET tool that needs to query project properties like Target Framework/s. My first thought has been Microsoft.CodeAnalysis.
using Microsoft.Build.Locator;
using Microsoft.CodeAnalysis.MSBuild;
public static class Program
{
public static async Task Main()
{
MSBuildLocator.RegisterDefaults();
using var workspace = MSBuildWorkspace.Create();
var pr = await workspace.OpenProjectAsync("E:\\Repos\\SuperJMN\\DotNet-Ssh-Deployer\\NetCoreSsh\\DotNetSsh.csproj");
}
}
I've loaded a project, and I can see a lot of information in the pr
instance, but I haven't found anything related to the TFMs.