Exemplo n.º 1
0
        static DotNetCoreRuntime()
        {
            var path = new DotNetCorePath();

            IsInstalled = !path.IsMissing;
            FileName    = path.FileName;

            Versions = DotNetCoreRuntimeVersions.GetInstalledVersions(path)
                       .OrderByDescending(version => version)
                       .ToArray();

            if (!IsInstalled)
            {
                LoggingService.LogInfo(".NET Core runtime not found.");
            }
        }
Exemplo n.º 2
0
        static void Init(DotNetCorePath path)
        {
            IsInstalled = !path.IsMissing;
            FileName    = path.FileName;

            Versions = DotNetCoreRuntimeVersions.GetInstalledVersions(path)
                       .OrderByDescending(version => version)
                       .ToArray();

            // If there are no runtimes then do not consider the runtime to be installed.
            if (!Versions.Any())
            {
                IsInstalled = false;
            }

            // Used by the DotNetMSBuildSdkResolver to find the .NET Core SDK.
            // Not sure this is needed - seems to work without it.
            Environment.SetEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR", path.ParentDirectory);
        }