2020-02-09 02:35:16 +00:00
|
|
|
using System;
|
2018-09-24 09:24:17 +00:00
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
namespace Jackett.Common.Utils
|
|
|
|
{
|
|
|
|
public static class DotNetCoreUtil
|
|
|
|
{
|
|
|
|
public static bool IsRunningOnDotNetCore
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2020-02-10 22:16:19 +00:00
|
|
|
var runningOnDotNetCore = false;
|
2018-09-24 09:24:17 +00:00
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
runningOnDotNetCore = RuntimeInformation.FrameworkDescription.IndexOf("core", StringComparison.OrdinalIgnoreCase) >= 0;
|
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
|
|
|
//Issue only appears to occur for small number of users on Mono
|
|
|
|
runningOnDotNetCore = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return runningOnDotNetCore;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|