From fd953738f036673690029a421388b2bd13a8a584 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Thu, 18 May 2017 21:09:09 -0700 Subject: [PATCH] Dropping a global.json when running the first run experience with a version that matches the version of the CLI being used in the command that triggered the first run. --- src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs b/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs index 297909c77..246d0f462 100644 --- a/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs +++ b/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System.IO; using System.Collections.Generic; using System.Linq; using Microsoft.DotNet.Cli.Utils; @@ -85,6 +86,14 @@ namespace Microsoft.DotNet.Configurer { var workingDirectory = temporaryDotnetNewDirectory.DirectoryPath; + File.WriteAllText( + Path.Combine(workingDirectory, "global.json"), + $@"{{ + ""sdk"": {{ + ""version"":""{Product.Version}"" + }} + }}"); + succeeded &= CreateTemporaryProject(workingDirectory, templateInfo); if (succeeded) @@ -129,6 +138,7 @@ namespace Microsoft.DotNet.Configurer if (commandResult.ExitCode != 0) { + Reporter.Verbose.WriteLine(commandResult.StdOut); Reporter.Verbose.WriteLine(commandResult.StdErr); Reporter.Error.WriteLine(