diff --git a/src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/HandlerResolver.cpp b/src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/HandlerResolver.cpp index bb4202398864..b7c7fbf97241 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/HandlerResolver.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/HandlerResolver.cpp @@ -56,7 +56,7 @@ HandlerResolver::LoadRequestHandlerAssembly(const IHttpApplication &pApplication { if (pConfiguration.QueryHostingModel() == APP_HOSTING_MODEL::HOSTING_IN_PROCESS) { - errorContext.generalErrorType = "ANCM In-Process Handler Load Failure"; + errorContext.generalErrorType = "ASP.NET Core IIS hosting failure (in-process)"; std::unique_ptr options; RETURN_IF_FAILED(HostFxrResolutionResult::Create( @@ -86,7 +86,7 @@ HandlerResolver::LoadRequestHandlerAssembly(const IHttpApplication &pApplication } else { - errorContext.generalErrorType = "ANCM Out-Of-Process Handler Load Failure"; + errorContext.generalErrorType = "ASP.NET Core IIS hosting failure (out-of-process)"; if (FAILED_LOG(hr = FindNativeAssemblyFromGlobalLocation(pConfiguration, pstrHandlerDllName, handlerDllPath))) { @@ -136,8 +136,8 @@ HandlerResolver::GetApplicationFactory(const IHttpApplication& pApplication, std errorContext.detailedErrorContent = to_multi_byte_string(format(ASPNETCORE_EVENT_MIXED_HOSTING_MODEL_ERROR_MSG, pApplication.GetApplicationId(), options.QueryHostingModel()), CP_UTF8); errorContext.statusCode = 500i16; errorContext.subStatusCode = 34i16; - errorContext.generalErrorType = "ANCM Mixed Hosting Models Not Supported"; - errorContext.errorReason = "Select a different application pool to create another application."; + errorContext.generalErrorType = "ASP.NET Core does not support mixing hosting models"; + errorContext.errorReason = "Select a different app pool to host this app."; EventLog::Error( ASPNETCORE_EVENT_MIXED_HOSTING_MODEL_ERROR, @@ -154,8 +154,8 @@ HandlerResolver::GetApplicationFactory(const IHttpApplication& pApplication, std errorContext.statusCode = 500i16; errorContext.subStatusCode = 35i16; - errorContext.generalErrorType = "ANCM Multiple In-Process Applications in same Process"; - errorContext.errorReason = "Select a different application pool to create another in-process application."; + errorContext.generalErrorType = "ASP.NET Core does not support multiple apps in the same app pool"; + errorContext.errorReason = "Select a different app pool to host this app."; EventLog::Error( ASPNETCORE_EVENT_DUPLICATED_INPROCESS_APP, @@ -251,8 +251,8 @@ try errorContext.detailedErrorContent = "Could not load hostfxr.dll."; errorContext.statusCode = 500i16; errorContext.subStatusCode = 32i16; - errorContext.generalErrorType = "ANCM Failed to Load dll"; - errorContext.errorReason = "The application was likely published for a different bitness than w3wp.exe/iisexpress.exe is running as."; + errorContext.generalErrorType = "Failed to load .NET Core host"; + errorContext.errorReason = "The app was likely published for a different bitness than w3wp.exe/iisexpress.exe is running as."; throw; } { @@ -302,7 +302,7 @@ try errorContext.statusCode = 500i16; errorContext.subStatusCode = 31i16; - errorContext.generalErrorType = "ANCM Failed to Find Native Dependencies"; + errorContext.generalErrorType = "Failed to load ASP.NET Core runtime"; errorContext.errorReason = "The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found."; EventLog::Error( @@ -347,7 +347,7 @@ try // This only occurs if the request handler isn't referenced by the app, which rarely happens if they are targeting the shared framework. errorContext.statusCode = 500i16; errorContext.subStatusCode = 33i16; - errorContext.generalErrorType = "ANCM Request Handler Load Failure"; + errorContext.generalErrorType = "Failed to load ASP.NET Core request handler"; errorContext.detailedErrorContent = to_multi_byte_string(format(ASPNETCORE_EVENT_INPROCESS_RH_REFERENCE_MSG, handlerDllPath.empty() ? s_pwzAspnetcoreInProcessRequestHandlerName : handlerDllPath.c_str()), diff --git a/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.cpp b/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.cpp index bd74be56b291..01b6ecfa7bce 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.cpp @@ -95,11 +95,11 @@ HostFxrResolver::GetHostFxrParameters( if (!is_regular_file(applicationDllPath)) { errorContext.subStatusCode = 38; - errorContext.errorReason = "Application DLL not found. Confirm the application dll is present. Single-file deployments are not supported in IIS."; - errorContext.generalErrorType = "ANCM Application DLL Not Found"; - errorContext.detailedErrorContent = format("Application DLL was not found at %s.", to_multi_byte_string(applicationDllPath, CP_UTF8).c_str()); + errorContext.errorReason = "The app couldn't be found. Confirm the app's main DLL is present. Single-file deployments are not supported in IIS."; + errorContext.generalErrorType = "Failed to locate ASP.NET Core app"; + errorContext.detailedErrorContent = format("Application was not found at %s.", to_multi_byte_string(applicationDllPath, CP_UTF8).c_str()); throw InvalidOperationException( - format(L"Application DLL was not found at %s. Confirm the application dll is present. Single-file deployments are not supported in IIS.", + format(L"The app couldn't be found at %s. Confirm the app's main DLL is present. Single-file deployments are not supported in IIS.", applicationDllPath.c_str())); } diff --git a/src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/dllmain.cpp b/src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/dllmain.cpp index fe7f9d10a0ea..29d4ad614ffe 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/dllmain.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/dllmain.cpp @@ -125,8 +125,8 @@ CreateApplication( ErrorContext errorContext; errorContext.statusCode = 500; errorContext.subStatusCode = 30; - errorContext.generalErrorType = "ANCM In-Process Start Failure"; - errorContext.errorReason = ""; + errorContext.generalErrorType = "ASP.NET Core app failed to start"; + errorContext.errorReason = ""; if (!FAILED_LOG(hr = IN_PROCESS_APPLICATION::Start(*pServer, pSite, *pHttpApplication, pParameters, nParameters, inProcessApplication, errorContext))) { diff --git a/src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp b/src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp index eb2f688f8c37..4f86cde3b852 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp @@ -165,8 +165,8 @@ IN_PROCESS_APPLICATION::LoadManagedApplication(ErrorContext& errorContext) // If server wasn't initialized in time shut application down without waiting for CLR thread to exit errorContext.statusCode = 500; errorContext.subStatusCode = 37; - errorContext.generalErrorType = "ANCM Failed to Start Within Startup Time Limit"; - errorContext.errorReason = format("ANCM failed to start after %d milliseconds", m_pConfig->QueryStartupTimeLimitInMS()); + errorContext.generalErrorType = "ASP.NET Core app failed to start within startup time limit"; + errorContext.errorReason = format("ASP.NET Core app failed to start after %d milliseconds", m_pConfig->QueryStartupTimeLimitInMS()); m_waitForShutdown = false; StopClr(); diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ErrorPagesTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ErrorPagesTests.cs index a1d540a8b3b4..5104520781f1 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ErrorPagesTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ErrorPagesTests.cs @@ -31,7 +31,7 @@ public async Task IncludesAdditionalErrorPageTextInProcessHandlerLoadFailure_Cor StopServer(); var responseString = await response.Content.ReadAsStringAsync(); - Assert.Contains("HTTP Error 500.0 - ANCM In-Process Handler Load Failure", responseString); + Assert.Contains("500.0", responseString); VerifyNoExtraTrailingBytes(responseString); await AssertLink(response); @@ -71,7 +71,7 @@ public async Task IncludesAdditionalErrorPageTextOutOfProcessHandlerLoadFailure_ StopServer(); var responseString = await response.Content.ReadAsStringAsync(); - Assert.Contains("HTTP Error 500.0 - ANCM Out-Of-Process Handler Load Failure", responseString); + Assert.Contains("500.0", responseString); VerifyNoExtraTrailingBytes(responseString); await AssertLink(response); @@ -94,7 +94,7 @@ public async Task IncludesAdditionalErrorPageTextInProcessStartupFailure_Correct StopServer(); var responseString = await response.Content.ReadAsStringAsync(); - Assert.Contains("HTTP Error 500.30 - ANCM In-Process Start Failure", responseString); + Assert.Contains("500.30", responseString); VerifyNoExtraTrailingBytes(responseString); await AssertLink(response); diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupExceptionTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupExceptionTests.cs index cb7fc11d298e..4dcd67f63c5c 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupExceptionTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupExceptionTests.cs @@ -91,7 +91,7 @@ public async Task Gets500_30_ErrorPage() Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); var responseText = await response.Content.ReadAsStringAsync(); - Assert.Contains("500.30 - ANCM In-Process Start Failure", responseText); + Assert.Contains("500.30", responseText); } } } diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs index 810dbd90a9af..5822b499b3a3 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs @@ -62,8 +62,14 @@ public async Task InvalidProcessPath_ExpectServerError(string path, string argum StopServer(); EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.UnableToStart(deploymentResult, subError), Logger); - - Assert.Contains("HTTP Error 500.0 - ANCM In-Process Handler Load Failure", await response.Content.ReadAsStringAsync()); + if (DeployerSelector.HasNewShim) + { + Assert.Contains("500.0", await response.Content.ReadAsStringAsync()); + } + else + { + Assert.Contains("500.0", await response.Content.ReadAsStringAsync()); + } } [ConditionalFact] @@ -271,7 +277,7 @@ public async Task RemoveHostfxrFromApp_InProcessHostfxrAPIAbsent() if (DeployerSelector.HasNewShim) { - await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.32 - ANCM Failed to Load dll"); + await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.32"); } else { @@ -314,11 +320,11 @@ public async Task PublishWithWrongBitness() if (DeployerSelector.HasNewShim) { - await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.32 - ANCM Failed to Load dll"); + await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.32"); } else { - await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.0 - ANCM In-Process Handler Load Failure"); + await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.0"); } } @@ -335,7 +341,7 @@ public async Task RemoveHostfxrFromApp_InProcessHostfxrLoadFailure() if (DeployerSelector.HasNewShim) { - await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.32 - ANCM Failed to Load dll"); + await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.32"); } else { @@ -354,7 +360,7 @@ public async Task TargedDifferenceSharedFramework_FailedToFindNativeDependencies Helpers.ModifyFrameworkVersionInRuntimeConfig(deploymentResult); if (DeployerSelector.HasNewShim) { - await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.31 - ANCM Failed to Find Native Dependencies"); + await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.31"); } else { @@ -374,7 +380,7 @@ public async Task SingleExecutable_FailedToFindNativeDependencies() File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll")); if (DeployerSelector.HasNewShim) { - await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.38 - ANCM Application DLL Not Found"); + await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.38"); } else { @@ -396,7 +402,7 @@ public async Task TargedDifferenceSharedFramework_FailedToFindNativeDependencies Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); var responseContent = await response.Content.ReadAsStringAsync(); - Assert.Contains("HTTP Error 500.31 - ANCM Failed to Find Native Dependencies", responseContent); + Assert.Contains("500.31", responseContent); Assert.Contains("The framework 'Microsoft.NETCore.App', version '2.9.9'", responseContent); } else @@ -416,14 +422,14 @@ public async Task RemoveInProcessReference_FailedToFindRequestHandler() if (DeployerSelector.HasNewShim && DeployerSelector.HasNewHandler) { - await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.33 - ANCM Request Handler Load Failure "); + await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.33"); EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessFailedToFindRequestHandler(deploymentResult), Logger); } else if (DeployerSelector.HasNewShim) { // Forwards compat tests fail earlier due to a error with the M.AspNetCore.Server.IIS package. - await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.31 - ANCM Failed to Find Native Dependencies"); + await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.31"); EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessFailedToFindNativeDependencies(deploymentResult), Logger); } @@ -462,7 +468,7 @@ public async Task StartupTimeoutIsApplied() if (DeployerSelector.HasNewHandler) { var responseContent = await response.Content.ReadAsStringAsync(); - Assert.Contains("ANCM Failed to Start Within Startup Time Limit", responseContent); + Assert.Contains("500.37", responseContent); } } } @@ -765,7 +771,6 @@ public async Task ExceptionIsLoggedToEventLogAndPutInResponseDuringHostingStartu Assert.Contains("InvalidOperationException", content); Assert.Contains("TestSite.Program.Main", content); Assert.Contains("From Configure", content); - Assert.DoesNotContain("ANCM In-Process Start Failure", content); StopServer(); @@ -932,7 +937,7 @@ private static void MoveApplication( private Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult) { - return AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.0 - ANCM In-Process Handler Load Failure"); + return AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.0"); } private async Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult, string error) diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/MultiApplicationTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/MultiApplicationTests.cs index eb94b683f13d..15a935410867 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/MultiApplicationTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/MultiApplicationTests.cs @@ -50,7 +50,7 @@ public async Task FailsAndLogsWhenRunningTwoInProcessApps() if (DeployerSelector.HasNewShim) { - Assert.Contains("500.35 - ANCM Multiple In-Process Applications in same Process", await result2.Content.ReadAsStringAsync()); + Assert.Contains("500.35", await result2.Content.ReadAsStringAsync()); } EventLogHelpers.VerifyEventLogEvent(result, EventLogHelpers.OnlyOneAppPerAppPool(), Logger); @@ -77,7 +77,7 @@ public async Task FailsAndLogsEventLogForMixedHostingModel(HostingModel firstApp if (DeployerSelector.HasNewShim) { - Assert.Contains("500.34 - ANCM Mixed Hosting Models Not Supported", await result2.Content.ReadAsStringAsync()); + Assert.Contains("500.34", await result2.Content.ReadAsStringAsync()); } EventLogHelpers.VerifyEventLogEvent(result, "Mixed hosting model is not supported.", Logger); diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/OutOfProcess/GlobalVersionTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/OutOfProcess/GlobalVersionTests.cs index 7837d47dce07..e94c4503fb2a 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/OutOfProcess/GlobalVersionTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/OutOfProcess/GlobalVersionTests.cs @@ -83,7 +83,7 @@ public async Task GlobalVersion_NewVersionNumber_Fails(string version) var response = await deploymentResult.HttpClient.GetAsync(_helloWorldRequest); Assert.False(response.IsSuccessStatusCode); var responseString = await response.Content.ReadAsStringAsync(); - Assert.Contains("HTTP Error 500.0 - ANCM Out-Of-Process Handler Load Failure", responseString); + Assert.Contains("500.0", responseString); } [ConditionalTheory]