pschelpdesk/Vendor/Prise/Utils/HostFrameworkUtils.cs
2024-11-04 20:45:34 +01:00

15 lines
473 B
C#

using System;
using System.Reflection;
using System.Runtime.Versioning;
namespace Prise.Utils
{
public static class HostFrameworkUtils
{
public static string GetHostframeworkFromHost() =>
Assembly.GetEntryAssembly().GetCustomAttribute<TargetFrameworkAttribute>()?.FrameworkName;
public static string GetHostframeworkFromType(Type type) =>
type.Assembly.GetCustomAttribute<TargetFrameworkAttribute>()?.FrameworkName;
}
}