Fixed the URL used when SDK commands fail to find SDK - this should point to the main download page.
Errors which talk about installing prerequisites now include platform specific URLs which point to the respective docs article for the correct platform.
The existing fwlink is now redirected to point to the Windows prereq page. Two new fwlinks were added to point to OSX and Linux pages.
Added simplistic tests for these changes.
Commit migrated from https://github.com/dotnet/core-setup/commit/
e6d577688072f3271ea16f6e472c7fad475e6d83
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(" - Installing .NET Core prerequisites might help resolve this problem:"));
- trace::error(_X(" %s"), DOTNET_CORE_GETTING_STARTED_URL);
trace::error(_X(" - The .NET Core framework and SDK can be installed from:"));
trace::error(_X(" %s"), DOTNET_CORE_DOWNLOAD_URL);
trace::error(_X(" %s at [%s]"), info.version.as_str().c_str(), info.path.c_str());
}
+
+ trace::error(_X(" - Installing .NET Core prerequisites might help resolve this problem:"));
+ trace::error(_X(" %s"), DOTNET_CORE_INSTALL_PREREQUISITES_URL);
}
/**
{
trace::error(_X(" It was not possible to find any installed dotnet SDKs"));
trace::error(_X(" Did you mean to run dotnet SDK commands? Please install dotnet SDK from:"));
- trace::error(_X(" %s"), DOTNET_CORE_GETTING_STARTED_URL);
+ trace::error(_X(" %s"), DOTNET_CORE_DOWNLOAD_URL);
}
return false;
}
};
#define _STRINGIFY(s) _X(s)
-#define DOTNET_CORE_GETTING_STARTED_URL _X("https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409")
+#if defined(_WIN32)
+#define DOTNET_CORE_INSTALL_PREREQUISITES_URL _X("https://go.microsoft.com/fwlink/?linkid=798306")
+#elif defined(__APPLE__)
+#define DOTNET_CORE_INSTALL_PREREQUISITES_URL _X("https://go.microsoft.com/fwlink/?linkid=2063366")
+#else
+#define DOTNET_CORE_INSTALL_PREREQUISITES_URL _X("https://go.microsoft.com/fwlink/?linkid=2063370")
+#endif
#define DOTNET_CORE_DOWNLOAD_RUNTIME_URL _X("https://aka.ms/dotnet-download-runtime")
#define DOTNET_CORE_DOWNLOAD_URL _X("https://aka.ms/dotnet-download")
{
trace::error(_X("The library %s was found, but loading it from %s failed"), LIBFXR_NAME, fxr_path.c_str());
trace::error(_X(" - Installing .NET Core prerequisites might help resolve this problem."));
- trace::error(_X(" %s"), DOTNET_CORE_GETTING_STARTED_URL);
+ trace::error(_X(" %s"), DOTNET_CORE_INSTALL_PREREQUISITES_URL);
return StatusCode::CoreHostLibLoadFailure;
}
.And
.HaveStdErrContaining("It was not possible to find any installed dotnet SDKs")
.And
+ .HaveStdErrContaining("aka.ms/dotnet-download")
+ .And
.NotHaveStdErrContaining("Checking if resolved SDK dir");
// Add SDK versions
using System;
using System.IO;
using Xunit;
+using System.Runtime.InteropServices;
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
.Should()
.Fail()
.And
- .HaveStdErrContaining("It was not possible to find any compatible framework version");
+ .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
SharedFramework.AddAvailableSharedFxVersions(_builtSharedFxDir, _exeSharedFxBaseDir, "9999.1.1");