From dded62282ee6aceee5b06bb9fc397d09fb8fce8b Mon Sep 17 00:00:00 2001 From: Rainer Sigwald Date: Wed, 21 Jun 2017 18:20:40 -0500 Subject: [PATCH 1/3] MSBuild 15.3.400 --- build/Microsoft.DotNet.Cli.DependencyVersions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Microsoft.DotNet.Cli.DependencyVersions.props b/build/Microsoft.DotNet.Cli.DependencyVersions.props index 862f8b91c..ed18c5be0 100644 --- a/build/Microsoft.DotNet.Cli.DependencyVersions.props +++ b/build/Microsoft.DotNet.Cli.DependencyVersions.props @@ -2,7 +2,7 @@ 1.1.2 - 15.3.0-preview-000388-01 + 15.3.0-preview-000400-01 2.3.0-beta3-61816-04 1.1.0-alpha-20170615-3 4.3.0-preview3-4168 From 6119a29f837b1dc65abc32ff0879733b177bf187 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Fri, 23 Jun 2017 08:53:04 -0500 Subject: [PATCH 2/3] Reenable UpdateVersionsRepo Now that https://github.com/dotnet/buildtools/issues/1547 is fixed. --- build/DependencyVersions.props | 2 +- build/publish/FinishBuild.targets | 5 ++--- build_projects/update-dependencies/Config.cs | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index ebc52549d..f70e36923 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -41,7 +41,7 @@ - 1.0.27-prerelease-01611-04 + 1.0.27-prerelease-01723-01 2.0.0-preview2-25331-01 diff --git a/build/publish/FinishBuild.targets b/build/publish/FinishBuild.targets index 709837429..69a9170ae 100644 --- a/build/publish/FinishBuild.targets +++ b/build/publish/FinishBuild.targets @@ -54,9 +54,8 @@ CommitHash="$(CommitHash)" Coherent="$(Coherent)" /> - - + GitHubPassword="$(GITHUB_PASSWORD)" /> diff --git a/build_projects/update-dependencies/Config.cs b/build_projects/update-dependencies/Config.cs index 9938cce68..0bd5a0c6a 100644 --- a/build_projects/update-dependencies/Config.cs +++ b/build_projects/update-dependencies/Config.cs @@ -82,7 +82,8 @@ namespace Microsoft.DotNet.Scripts private static string GetDefaultCoreSetupVersionFragment() { - string coreSetupChannel = GetRepoMSBuildPropValue("BundledRuntimes.props", "CoreSetupChannel") ?? "master"; + // by default, the current core-setup branch should match the current cli branch name + string coreSetupChannel = Instance.GitHubUpstreamBranch; return $"dotnet/core-setup/{coreSetupChannel}"; } From 37f531be4cbdc620b66fd31c2c8b6b98324926e8 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Fri, 23 Jun 2017 10:47:09 -0700 Subject: [PATCH 3/3] Handling an exception that happens when dotnet run is invoked with a file that is not a valid project file. We catch that exception and re-throw it as a GracefulException. --- src/dotnet/Properties/AssemblyInfo.cs | 1 + .../dotnet-run/LocalizableStrings.resx | 3 ++ src/dotnet/commands/dotnet-run/RunCommand.cs | 28 ++++++++++----- .../dotnet-run/xlf/LocalizableStrings.cs.xlf | 5 +++ .../dotnet-run/xlf/LocalizableStrings.de.xlf | 5 +++ .../dotnet-run/xlf/LocalizableStrings.es.xlf | 5 +++ .../dotnet-run/xlf/LocalizableStrings.fr.xlf | 5 +++ .../dotnet-run/xlf/LocalizableStrings.it.xlf | 5 +++ .../dotnet-run/xlf/LocalizableStrings.ja.xlf | 5 +++ .../dotnet-run/xlf/LocalizableStrings.ko.xlf | 5 +++ .../dotnet-run/xlf/LocalizableStrings.pl.xlf | 5 +++ .../xlf/LocalizableStrings.pt-BR.xlf | 5 +++ .../dotnet-run/xlf/LocalizableStrings.ru.xlf | 5 +++ .../dotnet-run/xlf/LocalizableStrings.tr.xlf | 5 +++ .../xlf/LocalizableStrings.zh-Hans.xlf | 5 +++ .../xlf/LocalizableStrings.zh-Hant.xlf | 5 +++ ...ThatWeCanPassNonProjectFilesToDotnetRun.cs | 35 +++++++++++++++++++ test/dotnet-run.Tests/dotnet-run.Tests.csproj | 4 +++ 18 files changed, 127 insertions(+), 9 deletions(-) create mode 100644 test/dotnet-run.Tests/GivenThatWeCanPassNonProjectFilesToDotnetRun.cs diff --git a/src/dotnet/Properties/AssemblyInfo.cs b/src/dotnet/Properties/AssemblyInfo.cs index edc4c971f..d7ae131d6 100644 --- a/src/dotnet/Properties/AssemblyInfo.cs +++ b/src/dotnet/Properties/AssemblyInfo.cs @@ -16,3 +16,4 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("dotnet-sln-list.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("dotnet-sln-remove.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("dotnet-msbuild.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("dotnet-run.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/dotnet/commands/dotnet-run/LocalizableStrings.resx b/src/dotnet/commands/dotnet-run/LocalizableStrings.resx index 976312b28..8cab1941e 100644 --- a/src/dotnet/commands/dotnet-run/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-run/LocalizableStrings.resx @@ -196,4 +196,7 @@ The current {1} is '{2}'. An error was encountered when reading launchSettings.json. {0} + + '{0}' is not a valid project file. + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/RunCommand.cs b/src/dotnet/commands/dotnet-run/RunCommand.cs index d760a8690..e4af4a2a0 100644 --- a/src/dotnet/commands/dotnet-run/RunCommand.cs +++ b/src/dotnet/commands/dotnet-run/RunCommand.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using Microsoft.Build.Evaluation; +using Microsoft.Build.Exceptions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.MSBuild; @@ -39,17 +40,26 @@ namespace Microsoft.DotNet.Tools.Run EnsureProjectIsBuilt(); } - ICommand runCommand = GetRunCommand(); - int launchSettingsApplicationResult = ApplyLaunchProfileSettingsIfNeeded(ref runCommand); - - if (launchSettingsApplicationResult != 0) + try { - return launchSettingsApplicationResult; - } + ICommand runCommand = GetRunCommand(); + int launchSettingsApplicationResult = ApplyLaunchProfileSettingsIfNeeded(ref runCommand); - return runCommand - .Execute() - .ExitCode; + if (launchSettingsApplicationResult != 0) + { + return launchSettingsApplicationResult; + } + + return runCommand + .Execute() + .ExitCode; + } + catch (InvalidProjectFileException e) + { + throw new GracefulException( + string.Format(LocalizableStrings.RunCommandSpecifiecFileIsNotAValidProject, Project), + e); + } } public RunCommand(string configuration, diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf index 8577240b2..5563eace5 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf @@ -136,6 +136,11 @@ Aktuální {1} je {2}. {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf index 7656a3d19..6e89d875e 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf @@ -136,6 +136,11 @@ Ein ausführbares Projekt sollte ein ausführbares TFM (z.B. netcoreapp2.0) verw {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf index 0a916fe88..d22b48eea 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf @@ -136,6 +136,11 @@ El actual {1} es '{2}'. {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf index cb48991d4..10a724eed 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf @@ -136,6 +136,11 @@ Le {1} actuel est '{2}'. {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf index aff5cb27a..530b36790 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf @@ -136,6 +136,11 @@ Il valore corrente di {1} è '{2}'. {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf index a5a82bde2..e7fd39294 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf @@ -136,6 +136,11 @@ The current {1} is '{2}'. {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf index ec71b08a4..7ea03bad9 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf @@ -136,6 +136,11 @@ The current {1} is '{2}'. {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf index 8690a8e73..f1a3f0ada 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf @@ -136,6 +136,11 @@ Bieżący element {1}: „{2}”. {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf index 7227491f9..e14a569d9 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf @@ -136,6 +136,11 @@ O {1} atual é '{2}'. {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf index 4cc54df57..cae65a320 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf @@ -136,6 +136,11 @@ The current {1} is '{2}'. {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf index 2d375d469..0c58521c8 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf @@ -136,6 +136,11 @@ Geçerli {1}: '{2}'. {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf index 2b962e69c..45c212b36 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf @@ -136,6 +136,11 @@ The current {1} is '{2}'. {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf index f7a942ece..bdc29aff7 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf @@ -136,6 +136,11 @@ The current {1} is '{2}'. {0} + + '{0}' is not a valid project file. + '{0}' is not a valid project file. + + \ No newline at end of file diff --git a/test/dotnet-run.Tests/GivenThatWeCanPassNonProjectFilesToDotnetRun.cs b/test/dotnet-run.Tests/GivenThatWeCanPassNonProjectFilesToDotnetRun.cs new file mode 100644 index 000000000..fafb147be --- /dev/null +++ b/test/dotnet-run.Tests/GivenThatWeCanPassNonProjectFilesToDotnetRun.cs @@ -0,0 +1,35 @@ +// 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 FluentAssertions; +using Microsoft.DotNet.TestFramework; +using Microsoft.DotNet.Tools.Test.Utilities; +using Xunit; + +namespace Microsoft.DotNet.Cli.Run.Tests +{ + public class GivenThatWeCanPassNonProjectFilesToDotnetRun : TestBase + { + [Fact] + public void ItFailsWithAnAppropriateErrorMessage() + { + var projectDirectory = TestAssets + .Get("SlnFileWithNoProjectReferences") + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + var slnFullPath = Path.Combine(projectDirectory, "SlnFileWithNoProjectReferences.sln"); + + new RunCommand() + .ExecuteWithCapturedOutput($"-p {slnFullPath}") + .Should().Fail() + .And.HaveStdErrContaining( + string.Format( + Microsoft.DotNet.Tools.Run.LocalizableStrings.RunCommandSpecifiecFileIsNotAValidProject, + slnFullPath)); + } + } +} \ No newline at end of file diff --git a/test/dotnet-run.Tests/dotnet-run.Tests.csproj b/test/dotnet-run.Tests/dotnet-run.Tests.csproj index e552a93fc..e1b7fbe50 100644 --- a/test/dotnet-run.Tests/dotnet-run.Tests.csproj +++ b/test/dotnet-run.Tests/dotnet-run.Tests.csproj @@ -6,11 +6,15 @@ $(CLI_SharedFrameworkVersion) true dotnet-run.Tests + ../../tools/Key.snk + true + true $(AssetTargetFallback);dotnet5.4;portable-net451+win8 +