This repository has been archived on 2025-09-07. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
dotnet-installer/tools/MultiProjectValidator/ProjectContextExtensions.cs

18 lines
496 B
C#
Raw Normal View History

using System.IO;
using System.Collections.Generic;
using Microsoft.DotNet.ProjectModel;
namespace MultiProjectValidator
{
public static class ProjectContextExtensions
{
private static readonly string s_desktopTfmPrefix = ".NETFramework";
public static bool TargetIsDesktop(this ProjectContext context)
{
var targetFramework = context.TargetFramework.ToString();
return targetFramework.StartsWith(s_desktopTfmPrefix);
}
}
}