Improve missing framework error message
authorSteve MacLean <Steve.MacLean@Microsoft.com>
Wed, 27 Feb 2019 21:10:36 +0000 (16:10 -0500)
committerSteve MacLean <Steve.MacLean@Microsoft.com>
Thu, 28 Feb 2019 08:48:33 +0000 (03:48 -0500)
Commit migrated from https://github.com/dotnet/core-setup/commit/b2918e232f48bdf3040a1a8aa0f37cba7a6b7254

src/installer/corehost/cli/fxr/fx_muxer.cpp
src/installer/test/HostActivationTests/GivenThatICareAboutSharedFxLookup.cs

index e2bcc96..023b6a6 100644 (file)
@@ -238,31 +238,27 @@ void fx_muxer_t::display_missing_framework_error(
     }
     else
     {
-        trace::error(_X("No frameworks were found."));
+        trace::error(_X("The specified framework '%s' was not found."), fx_name.c_str());
     }
 
-    trace::error(_X("  - Check application dependencies and target a framework version installed at:"));
-    trace::error(_X("      %s"), fx_ver_dirs.c_str());
-    trace::error(_X("  - The .NET Core Runtime and SDK can be installed from:"));
-    trace::error(_X("      %s"), DOTNET_CORE_DOWNLOAD_URL);
-
-    // Gather the list of versions installed at the shared FX location.
-    bool is_print_header = true;
-
-    for (const framework_info& info : framework_infos)
+    if (framework_infos.size())
     {
-        // Print banner only once before printing the versions
-        if (is_print_header)
+        trace::error(_X("  - The following frameworks were found:"));
+        for (const framework_info& info : framework_infos)
         {
-            trace::error(_X("  - The following versions are installed:"));
-            is_print_header = false;
+            trace::error(_X("      %s at [%s]"), info.version.as_str().c_str(), info.path.c_str());
         }
-
-        trace::error(_X("      %s at [%s]"), info.version.as_str().c_str(), info.path.c_str());
+    }
+    else
+    {
+        trace::error(_X("  - No frameworks were found."));
     }
 
-    trace::error(_X("  - Installing .NET Core prerequisites might help resolve this problem:"));
-    trace::error(_X("      %s"), DOTNET_CORE_INSTALL_PREREQUISITES_URL);
+    trace::error(_X(""));
+    trace::error(_X("You can resolve the problem by installing the specified framework and/or SDK."));
+    trace::error(_X(""));
+    trace::error(_X("The .NET Core framework can be found at:"));
+    trace::error(_X("  - %s"), DOTNET_CORE_DOWNLOAD_URL);
 }
 
 /**
index 9743caa..9958e65 100644 (file)
@@ -358,20 +358,6 @@ namespace Microsoft.DotNet.CoreSetup.Test.HostActivation.SharedFxLookup
             // Add some dummy versions in the exe
             SharedFramework.AddAvailableSharedFxVersions(_builtSharedFxDir, _exeSharedFxBaseDir, "10000.1.1");
 
-            string expectedPrereqInstallUrl;
-            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
-            {
-                expectedPrereqInstallUrl = "https://go.microsoft.com/fwlink/?linkid=798306";
-            }
-            else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
-            {
-                expectedPrereqInstallUrl = "https://go.microsoft.com/fwlink/?linkid=2063366";
-            }
-            else
-            {
-                expectedPrereqInstallUrl = "https://go.microsoft.com/fwlink/?linkid=2063370";
-            }
-
             // Version: 9999.0.0
             // 'Roll forward on no candidate fx' default value of 1 (minor)
             // exe: 10000.1.1
@@ -387,8 +373,6 @@ namespace Microsoft.DotNet.CoreSetup.Test.HostActivation.SharedFxLookup
                 .And
                 .HaveStdErrContaining("It was not possible to find any compatible framework version")
                 .And
-                .HaveStdErrContaining(expectedPrereqInstallUrl)
-                .And
                 .HaveStdErrContaining("aka.ms/dotnet-download");
 
             // Add a dummy version in the exe dir