internal static Runtime GetCurrentRuntime()
        {
            //do not change the order of conditions because it may cause incorrect determination of runtime
            if (IsMono)
            {
                return(MonoRuntime.Default);
            }
            if (IsFullFramework)
            {
                return(ClrRuntime.GetCurrentVersion());
            }
            if (IsWasm)
            {
                return(WasmRuntime.Default);
            }
            if (IsNetCore)
            {
                return(CoreRuntime.GetCurrentVersion());
            }
            if (IsCoreRT)
            {
                return(CoreRtRuntime.GetCurrentVersion());
            }

            throw new NotSupportedException("Unknown .NET Runtime");
        }
Esempio n. 2
0
        protected string GetTargetFrameworkMoniker()
        {
            if (!string.IsNullOrEmpty(targetFrameworkMoniker))
            {
                return(targetFrameworkMoniker);
            }
            if (!RuntimeInformation.IsNetCore)
            {
                throw new NotSupportedException("You must specify the target framework moniker in explicit way using builder.TargetFrameworkMoniker(tfm) method");
            }

            return(CoreRuntime.GetCurrentVersion().MsBuildMoniker);
        }
 public CoreJobAttribute() : base(Job.Default.With(CoreRuntime.GetCurrentVersion()))
 {
 }
Esempio n. 4
0
 public DryCoreJobAttribute() : base(Job.Dry.With(CoreRuntime.GetCurrentVersion()))
 {
 }