Update static HTML with name ASP.NET Core Module instead of ANCM (#18346)

This commit is contained in:
Justin Kotalik 2020-01-21 15:00:00 -08:00 committed by GitHub
parent f1dba10a34
commit bc60e9576f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 44 additions and 39 deletions

View File

@ -56,7 +56,7 @@ HandlerResolver::LoadRequestHandlerAssembly(const IHttpApplication &pApplication
{ {
if (pConfiguration.QueryHostingModel() == APP_HOSTING_MODEL::HOSTING_IN_PROCESS) 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<HostFxrResolutionResult> options; std::unique_ptr<HostFxrResolutionResult> options;
RETURN_IF_FAILED(HostFxrResolutionResult::Create( RETURN_IF_FAILED(HostFxrResolutionResult::Create(
@ -86,7 +86,7 @@ HandlerResolver::LoadRequestHandlerAssembly(const IHttpApplication &pApplication
} }
else 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))) 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.detailedErrorContent = to_multi_byte_string(format(ASPNETCORE_EVENT_MIXED_HOSTING_MODEL_ERROR_MSG, pApplication.GetApplicationId(), options.QueryHostingModel()), CP_UTF8);
errorContext.statusCode = 500i16; errorContext.statusCode = 500i16;
errorContext.subStatusCode = 34i16; errorContext.subStatusCode = 34i16;
errorContext.generalErrorType = "ANCM Mixed Hosting Models Not Supported"; errorContext.generalErrorType = "ASP.NET Core does not support mixing hosting models";
errorContext.errorReason = "Select a different application pool to create another application."; errorContext.errorReason = "Select a different app pool to host this app.";
EventLog::Error( EventLog::Error(
ASPNETCORE_EVENT_MIXED_HOSTING_MODEL_ERROR, ASPNETCORE_EVENT_MIXED_HOSTING_MODEL_ERROR,
@ -154,8 +154,8 @@ HandlerResolver::GetApplicationFactory(const IHttpApplication& pApplication, std
errorContext.statusCode = 500i16; errorContext.statusCode = 500i16;
errorContext.subStatusCode = 35i16; errorContext.subStatusCode = 35i16;
errorContext.generalErrorType = "ANCM Multiple In-Process Applications in same Process"; errorContext.generalErrorType = "ASP.NET Core does not support multiple apps in the same app pool";
errorContext.errorReason = "Select a different application pool to create another in-process application."; errorContext.errorReason = "Select a different app pool to host this app.";
EventLog::Error( EventLog::Error(
ASPNETCORE_EVENT_DUPLICATED_INPROCESS_APP, ASPNETCORE_EVENT_DUPLICATED_INPROCESS_APP,
@ -251,8 +251,8 @@ try
errorContext.detailedErrorContent = "Could not load hostfxr.dll."; errorContext.detailedErrorContent = "Could not load hostfxr.dll.";
errorContext.statusCode = 500i16; errorContext.statusCode = 500i16;
errorContext.subStatusCode = 32i16; errorContext.subStatusCode = 32i16;
errorContext.generalErrorType = "ANCM Failed to Load dll"; errorContext.generalErrorType = "Failed to load .NET Core host";
errorContext.errorReason = "The application was likely published for a different bitness than w3wp.exe/iisexpress.exe is running as."; errorContext.errorReason = "The app was likely published for a different bitness than w3wp.exe/iisexpress.exe is running as.";
throw; throw;
} }
{ {
@ -302,7 +302,7 @@ try
errorContext.statusCode = 500i16; errorContext.statusCode = 500i16;
errorContext.subStatusCode = 31i16; 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."; errorContext.errorReason = "The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.";
EventLog::Error( 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. // 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.statusCode = 500i16;
errorContext.subStatusCode = 33i16; 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() errorContext.detailedErrorContent = to_multi_byte_string(format(ASPNETCORE_EVENT_INPROCESS_RH_REFERENCE_MSG, handlerDllPath.empty()
? s_pwzAspnetcoreInProcessRequestHandlerName ? s_pwzAspnetcoreInProcessRequestHandlerName
: handlerDllPath.c_str()), : handlerDllPath.c_str()),

View File

@ -95,11 +95,11 @@ HostFxrResolver::GetHostFxrParameters(
if (!is_regular_file(applicationDllPath)) if (!is_regular_file(applicationDllPath))
{ {
errorContext.subStatusCode = 38; errorContext.subStatusCode = 38;
errorContext.errorReason = "Application DLL not found. Confirm the application dll is present. Single-file deployments are not supported in IIS."; 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 = "ANCM Application DLL Not Found"; errorContext.generalErrorType = "Failed to locate ASP.NET Core app";
errorContext.detailedErrorContent = format("Application DLL was not found at %s.", to_multi_byte_string(applicationDllPath, CP_UTF8).c_str()); errorContext.detailedErrorContent = format("Application was not found at %s.", to_multi_byte_string(applicationDllPath, CP_UTF8).c_str());
throw InvalidOperationException( 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())); applicationDllPath.c_str()));
} }

View File

@ -125,8 +125,8 @@ CreateApplication(
ErrorContext errorContext; ErrorContext errorContext;
errorContext.statusCode = 500; errorContext.statusCode = 500;
errorContext.subStatusCode = 30; errorContext.subStatusCode = 30;
errorContext.generalErrorType = "ANCM In-Process Start Failure"; errorContext.generalErrorType = "ASP.NET Core app failed to start";
errorContext.errorReason = "<ul><li>The application failed to start</li><li>The application started but then stopped</li><li>The application started but threw an exception during startup</li></ul>"; errorContext.errorReason = "<ul><li>The app failed to start</li><li>The app started but then stopped</li><li>The app started but threw an exception during startup</li></ul>";
if (!FAILED_LOG(hr = IN_PROCESS_APPLICATION::Start(*pServer, pSite, *pHttpApplication, pParameters, nParameters, inProcessApplication, errorContext))) if (!FAILED_LOG(hr = IN_PROCESS_APPLICATION::Start(*pServer, pSite, *pHttpApplication, pParameters, nParameters, inProcessApplication, errorContext)))
{ {

View File

@ -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 // If server wasn't initialized in time shut application down without waiting for CLR thread to exit
errorContext.statusCode = 500; errorContext.statusCode = 500;
errorContext.subStatusCode = 37; errorContext.subStatusCode = 37;
errorContext.generalErrorType = "ANCM Failed to Start Within Startup Time Limit"; errorContext.generalErrorType = "ASP.NET Core app failed to start within startup time limit";
errorContext.errorReason = format("ANCM failed to start after %d milliseconds", m_pConfig->QueryStartupTimeLimitInMS()); errorContext.errorReason = format("ASP.NET Core app failed to start after %d milliseconds", m_pConfig->QueryStartupTimeLimitInMS());
m_waitForShutdown = false; m_waitForShutdown = false;
StopClr(); StopClr();

View File

@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
StopServer(); StopServer();
var responseString = await response.Content.ReadAsStringAsync(); 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); VerifyNoExtraTrailingBytes(responseString);
await AssertLink(response); await AssertLink(response);
@ -71,7 +71,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
StopServer(); StopServer();
var responseString = await response.Content.ReadAsStringAsync(); 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); VerifyNoExtraTrailingBytes(responseString);
await AssertLink(response); await AssertLink(response);
@ -94,7 +94,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
StopServer(); StopServer();
var responseString = await response.Content.ReadAsStringAsync(); 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); VerifyNoExtraTrailingBytes(responseString);
await AssertLink(response); await AssertLink(response);

View File

@ -91,7 +91,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
var responseText = await response.Content.ReadAsStringAsync(); var responseText = await response.Content.ReadAsStringAsync();
Assert.Contains("500.30 - ANCM In-Process Start Failure", responseText); Assert.Contains("500.30", responseText);
} }
} }
} }

View File

@ -62,8 +62,14 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
StopServer(); StopServer();
EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.UnableToStart(deploymentResult, subError), Logger); EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.UnableToStart(deploymentResult, subError), Logger);
if (DeployerSelector.HasNewShim)
Assert.Contains("HTTP Error 500.0 - ANCM In-Process Handler Load Failure", await response.Content.ReadAsStringAsync()); {
Assert.Contains("500.0", await response.Content.ReadAsStringAsync());
}
else
{
Assert.Contains("500.0", await response.Content.ReadAsStringAsync());
}
} }
[ConditionalFact] [ConditionalFact]
@ -271,7 +277,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
if (DeployerSelector.HasNewShim) if (DeployerSelector.HasNewShim)
{ {
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.32 - ANCM Failed to Load dll"); await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.32");
} }
else else
{ {
@ -314,11 +320,11 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
if (DeployerSelector.HasNewShim) if (DeployerSelector.HasNewShim)
{ {
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.32 - ANCM Failed to Load dll"); await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.32");
} }
else else
{ {
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.0 - ANCM In-Process Handler Load Failure"); await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.0");
} }
} }
@ -335,7 +341,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
if (DeployerSelector.HasNewShim) if (DeployerSelector.HasNewShim)
{ {
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.32 - ANCM Failed to Load dll"); await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.32");
} }
else else
{ {
@ -354,7 +360,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
Helpers.ModifyFrameworkVersionInRuntimeConfig(deploymentResult); Helpers.ModifyFrameworkVersionInRuntimeConfig(deploymentResult);
if (DeployerSelector.HasNewShim) if (DeployerSelector.HasNewShim)
{ {
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.31 - ANCM Failed to Find Native Dependencies"); await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.31");
} }
else else
{ {
@ -374,7 +380,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll")); File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"));
if (DeployerSelector.HasNewShim) if (DeployerSelector.HasNewShim)
{ {
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.38 - ANCM Application DLL Not Found"); await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.38");
} }
else else
{ {
@ -396,7 +402,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
var responseContent = await response.Content.ReadAsStringAsync(); 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); Assert.Contains("The framework 'Microsoft.NETCore.App', version '2.9.9'", responseContent);
} }
else else
@ -416,14 +422,14 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
if (DeployerSelector.HasNewShim && DeployerSelector.HasNewHandler) 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); EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessFailedToFindRequestHandler(deploymentResult), Logger);
} }
else if (DeployerSelector.HasNewShim) else if (DeployerSelector.HasNewShim)
{ {
// Forwards compat tests fail earlier due to a error with the M.AspNetCore.Server.IIS package. // 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); EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessFailedToFindNativeDependencies(deploymentResult), Logger);
} }
@ -462,7 +468,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
if (DeployerSelector.HasNewHandler) if (DeployerSelector.HasNewHandler)
{ {
var responseContent = await response.Content.ReadAsStringAsync(); 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 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
Assert.Contains("InvalidOperationException", content); Assert.Contains("InvalidOperationException", content);
Assert.Contains("TestSite.Program.Main", content); Assert.Contains("TestSite.Program.Main", content);
Assert.Contains("From Configure", content); Assert.Contains("From Configure", content);
Assert.DoesNotContain("ANCM In-Process Start Failure", content);
StopServer(); StopServer();
@ -932,7 +937,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess
private Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult) 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) private async Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult, string error)

View File

@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
if (DeployerSelector.HasNewShim) 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); EventLogHelpers.VerifyEventLogEvent(result, EventLogHelpers.OnlyOneAppPerAppPool(), Logger);
@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
if (DeployerSelector.HasNewShim) 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); EventLogHelpers.VerifyEventLogEvent(result, "Mixed hosting model is not supported.", Logger);

View File

@ -83,7 +83,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.OutOfProcess
var response = await deploymentResult.HttpClient.GetAsync(_helloWorldRequest); var response = await deploymentResult.HttpClient.GetAsync(_helloWorldRequest);
Assert.False(response.IsSuccessStatusCode); Assert.False(response.IsSuccessStatusCode);
var responseString = await response.Content.ReadAsStringAsync(); 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] [ConditionalTheory]