Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ public void AppHost_GUI_NoCustomErrorWriter_FrameworkMissing_ErrorReportedInDial
Directory.CreateDirectory(dotnetWithMockHostFxr);
string expectedErrorCode = Constants.ErrorCode.FrameworkMissingFailure.ToString("x");

var dotnetBuilder = new DotNetBuilder(dotnetWithMockHostFxr, sharedTestState.RepoDirectories.BuiltDotnet, "hostfxrFrameworkMissingFailure")
var dotnetBuilder = new DotNetBuilder(dotnetWithMockHostFxr, sharedTestState.RepoDirectories.BuiltDotnet, "mockhostfxrFrameworkMissingFailure")
.RemoveHostFxr()
.AddMockHostFxr(new Version(2, 2, 0));
var dotnet = dotnetBuilder.Build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void Bundled_Framework_dependent_App_GUI_DownlevelHostFxr_ErrorDialog(Bun
Directory.CreateDirectory(dotnetWithMockHostFxr);
string expectedErrorCode = Constants.ErrorCode.BundleExtractionFailure.ToString("x");

var dotnetBuilder = new DotNetBuilder(dotnetWithMockHostFxr, sharedTestState.RepoDirectories.BuiltDotnet, "hostfxrFrameworkMissingFailure")
var dotnetBuilder = new DotNetBuilder(dotnetWithMockHostFxr, sharedTestState.RepoDirectories.BuiltDotnet, "mockhostfxrBundleVersionFailure")
.RemoveHostFxr()
.AddMockHostFxr(new Version(5, 0, 0));
var dotnet = dotnetBuilder.Build();
Expand All @@ -87,7 +87,8 @@ public void Bundled_Framework_dependent_App_GUI_DownlevelHostFxr_ErrorDialog(Bun
.WaitForExit(true)
.Should().Fail()
.And.HaveStdErrContaining("Bundle header version compatibility check failed.")
.And.HaveStdErrContaining($"Showing error dialog for application: '{Path.GetFileName(singleFile)}' - error code: 0x{expectedErrorCode}");
.And.HaveStdErrContaining($"Showing error dialog for application: '{Path.GetFileName(singleFile)}' - error code: 0x{expectedErrorCode}")
.And.HaveStdErrContaining("apphost_version=");
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/native/corehost/apphost/apphost.windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ namespace
{
dialogMsg = pal::string_t(_X("To run this application, you must install .NET Desktop Runtime ")) + _STRINGIFY(COMMON_HOST_PKG_VER) + _X(" (") + get_arch() + _X(").\n\n");
url = get_download_url();
url.append(_X("&apphost_version="));
url.append(_STRINGIFY(COMMON_HOST_PKG_VER));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/native/corehost/bundle/header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ header_t header_t::read(reader_t& reader)
if (!fixed_header->is_valid())
{
trace::error(_X("Failure processing application bundle."));
trace::error(_X("Bundle header version compatibility check failed."));
trace::error(_X("Bundle header version compatibility check failed. Header version: %d.%d"), fixed_header->major_version, fixed_header->minor_version);

throw StatusCode::BundleExtractionFailure;
}
Expand Down
8 changes: 4 additions & 4 deletions src/native/corehost/test/mockhostfxr/mockhostfxr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ SHARED_API int HOSTFXR_CALLTYPE hostfxr_main_startupinfo(const int argc, const p
{
trace_hostfxr_entry_point(_X("hostfxr_main_startupinfo"));

const pal::string_t dotnet_folder = get_directory(dotnet_root);
const pal::string_t dotnet_folder = get_filename(dotnet_root);

if (pal::strcmp(dotnet_folder.c_str(), _X("hostfxrFrameworkMissingFailure")))
if (pal::strcmp(dotnet_folder.c_str(), _X("mockhostfxrFrameworkMissingFailure")) == 0)
{
return StatusCode::FrameworkMissingFailure;
}
Expand All @@ -38,9 +38,9 @@ SHARED_API int HOSTFXR_CALLTYPE hostfxr_main_bundle_startupinfo(const int argc,
{
trace_hostfxr_entry_point(_X("hostfxr_main_bundle_startupinfo"));

const pal::string_t dotnet_folder = get_directory(dotnet_root);
const pal::string_t dotnet_folder = get_filename(dotnet_root);

if (pal::strcmp(dotnet_folder.c_str(), _X("mockhostfxrBundleVersionFailure")))
if (pal::strcmp(dotnet_folder.c_str(), _X("mockhostfxrBundleVersionFailure")) == 0)
{
trace::error(_X("Failure processing application bundle."));
trace::error(_X("Bundle header version compatibility check failed."));
Expand Down