Пример #1
0
        public static IEnumerable <TargetFramework> GetNetStandardTargetFrameworks()
        {
            if (DotNetCoreRuntime.IsNetCore2xInstalled() || MonoRuntimeInfoExtensions.CurrentRuntimeVersion.SupportsNetStandard20())
            {
                yield return(CreateTargetFramework(".NETStandard", "2.0"));
            }

            foreach (var targetFramework in GetTargetFrameworksVersion1x(".NETStandard", HighestNetStandard1xMinorVersionSupported).Reverse())
            {
                yield return(targetFramework);
            }
        }
        public static IEnumerable <TargetFramework> GetNetStandardTargetFrameworks()
        {
            if (DotNetCoreRuntime.IsNetCore20Installed())
            {
                yield return(CreateTargetFramework(".NETStandard", "2.0"));
            }

            if (DotNetCoreRuntime.IsNetCore20Installed() || DotNetCoreRuntime.IsNetCore1xInstalled())
            {
                foreach (var targetFramework in GetTargetFrameworksVersion1x(".NETStandard", HighestNetStandard1xMinorVersionSupported).Reverse())
                {
                    yield return(targetFramework);
                }
            }
        }
        protected override Task OnExecute(
            ProgressMonitor monitor,
            ExecutionContext context,
            ConfigurationSelector configuration,
            TargetFrameworkMoniker framework,
            SolutionItemRunConfiguration runConfiguration)
        {
            var requiredVersion = DotNetCoreVersion.Parse(Project.TargetFramework.Id.Version);

            if (DotNetCoreRuntime.IsMissing)
            {
                return(ShowCannotExecuteDotNetCoreApplicationDialog(DotNetCoreRuntime.GetNotInstalledVersionMessage(requiredVersion.OriginalString), requiredVersion));
            }
            if (Project.TargetFramework.IsNetCoreApp() &&
                !DotNetCoreRuntime.Versions.Any(x => x.OriginalString.StartsWith(Project.TargetFramework.Id.Version, StringComparison.OrdinalIgnoreCase)))
            {
                return(ShowCannotExecuteDotNetCoreApplicationDialog(DotNetCoreRuntime.GetNotInstalledVersionMessage(requiredVersion.OriginalString), requiredVersion));
            }

            return(base.OnExecute(monitor, context, configuration, framework, runConfiguration));
        }