Wie bekomme ich das Zielrahmen/s eines Projekts (.csproj) unter Verwendung von Microsoft.Codeanalyse (oder ähnlich)?C#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Wie bekomme ich das Zielrahmen/s eines Projekts (.csproj) unter Verwendung von Microsoft.Codeanalyse (oder ähnlich)?

Post by Anonymous »

Ich erstelle ein .NET -Tool, das Projekteigenschaften wie Ziel Framework/s abfragen muss. Mein erster Gedanke war Microsoft.CodeAnalysis. < /P>

Code: Select all

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");
}
}
Ich habe ein Projekt geladen, und ich kann viele Informationen in der PR -Instanz sehen, aber ich habe nichts gefunden, was mit den TFMs zu tun hat.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post