var projectInstance = new ProjectInstance(projectFilePath); string outputPath = projectInstance.GetPropertyValue("OutputPath"); Console.WriteLine(outputPath);
var projectInstance = new ProjectInstance(projectFilePath); string targetFramework = projectInstance.GetPropertyValue("TargetFramework"); Console.WriteLine(targetFramework);
var projectInstance = new ProjectInstance(projectFilePath); string customProperty = projectInstance.GetPropertyValue("MyCustomProperty"); Console.WriteLine(customProperty);In this example, `projectFilePath` is the path to the project file. The `ProjectInstance` class is used to load the project file into a project instance. The `GetPropertyValue` method is used to get the value of a custom property named "MyCustomProperty" from the project instance and store it in the `customProperty` variable. The value of the custom property is then printed to the console. Package library: Microsoft.Build