protected override bool OnGetSupportsFramework(TargetFramework framework) { if (framework.IsNetCoreApp() || framework.IsNetStandard()) { return(true); } return(base.OnGetSupportsFramework(framework)); }
public static bool IsLowerThanNetStandard16(this TargetFramework framework) { if (framework.IsNetStandard("2.0")) { return(false); } return(framework.IsNetStandard1x() && framework.Id.Version != "1.6"); }
protected override bool OnGetSupportsFramework(TargetFramework framework) { if (Project.HasMultipleTargetFrameworks) { // Gets called when assigning the Project.TargetFramework. The framework being set may not be // supported by the DotNetCoreProjectExtension but one of the multi-target frameworks will be // supported so return true to allow the Project to be loaded. return(true); } return(framework.IsNetCoreApp() || framework.IsNetStandard()); }
public static string GetDisplayName(this TargetFramework framework) { if (framework.IsNetCoreApp()) { return(string.Format(".NET Core {0}", framework.Id.Version)); } if (framework.IsNetStandard()) { return(string.Format(".NET Standard {0}", framework.Id.Version)); } return(framework.Name); }
public IEnumerable <TargetFramework> GetFrameworks() { if (framework.IsNetStandard()) { return(GetNetStandardTargetFrameworks()); } else if (framework.IsNetCoreApp()) { return(GetNetCoreAppTargetFrameworksWithSdkSupport()); } else if (framework.IsNetFramework()) { return(GetNetFrameworkTargetFrameworks()); } return(new TargetFramework [0]); }
public static string GetParameterName(this TargetFramework framework) { var parameter = framework.Id.Version; //special case for 1.x if (framework.IsVersion1x()) { parameter = "1x"; } parameter = parameter.Replace(".", string.Empty); if (framework.IsNetCoreApp()) { return($"UseNetCore{parameter}"); } if (framework.IsNetStandard()) { return($"UseNetStandard{parameter}"); } return(string.Empty); }
public static bool IsNetStandard1x(this TargetFramework framework) { return(framework.IsNetStandard() && framework.IsVersion1x()); }
public static bool IsNetStandard20(this TargetFramework framework) { return(framework.IsNetStandard() && framework.Id.Version == "2.0"); }
public static bool IsNetStandard20OrNetCore20(this TargetFramework framework) => framework.IsNetStandard("2.0") || framework.IsNetCoreApp("2.0");