Skip to content

Commit bc60e95

Browse files
authored
Update static HTML with name ASP.NET Core Module instead of ANCM (#18346)
1 parent f1dba10 commit bc60e95

File tree

9 files changed

+44
-39
lines changed

9 files changed

+44
-39
lines changed

src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/HandlerResolver.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ HandlerResolver::LoadRequestHandlerAssembly(const IHttpApplication &pApplication
5656
{
5757
if (pConfiguration.QueryHostingModel() == APP_HOSTING_MODEL::HOSTING_IN_PROCESS)
5858
{
59-
errorContext.generalErrorType = "ANCM In-Process Handler Load Failure";
59+
errorContext.generalErrorType = "ASP.NET Core IIS hosting failure (in-process)";
6060
std::unique_ptr<HostFxrResolutionResult> options;
6161

6262
RETURN_IF_FAILED(HostFxrResolutionResult::Create(
@@ -86,7 +86,7 @@ HandlerResolver::LoadRequestHandlerAssembly(const IHttpApplication &pApplication
8686
}
8787
else
8888
{
89-
errorContext.generalErrorType = "ANCM Out-Of-Process Handler Load Failure";
89+
errorContext.generalErrorType = "ASP.NET Core IIS hosting failure (out-of-process)";
9090

9191
if (FAILED_LOG(hr = FindNativeAssemblyFromGlobalLocation(pConfiguration, pstrHandlerDllName, handlerDllPath)))
9292
{
@@ -136,8 +136,8 @@ HandlerResolver::GetApplicationFactory(const IHttpApplication& pApplication, std
136136
errorContext.detailedErrorContent = to_multi_byte_string(format(ASPNETCORE_EVENT_MIXED_HOSTING_MODEL_ERROR_MSG, pApplication.GetApplicationId(), options.QueryHostingModel()), CP_UTF8);
137137
errorContext.statusCode = 500i16;
138138
errorContext.subStatusCode = 34i16;
139-
errorContext.generalErrorType = "ANCM Mixed Hosting Models Not Supported";
140-
errorContext.errorReason = "Select a different application pool to create another application.";
139+
errorContext.generalErrorType = "ASP.NET Core does not support mixing hosting models";
140+
errorContext.errorReason = "Select a different app pool to host this app.";
141141

142142
EventLog::Error(
143143
ASPNETCORE_EVENT_MIXED_HOSTING_MODEL_ERROR,
@@ -154,8 +154,8 @@ HandlerResolver::GetApplicationFactory(const IHttpApplication& pApplication, std
154154

155155
errorContext.statusCode = 500i16;
156156
errorContext.subStatusCode = 35i16;
157-
errorContext.generalErrorType = "ANCM Multiple In-Process Applications in same Process";
158-
errorContext.errorReason = "Select a different application pool to create another in-process application.";
157+
errorContext.generalErrorType = "ASP.NET Core does not support multiple apps in the same app pool";
158+
errorContext.errorReason = "Select a different app pool to host this app.";
159159

160160
EventLog::Error(
161161
ASPNETCORE_EVENT_DUPLICATED_INPROCESS_APP,
@@ -251,8 +251,8 @@ try
251251
errorContext.detailedErrorContent = "Could not load hostfxr.dll.";
252252
errorContext.statusCode = 500i16;
253253
errorContext.subStatusCode = 32i16;
254-
errorContext.generalErrorType = "ANCM Failed to Load dll";
255-
errorContext.errorReason = "The application was likely published for a different bitness than w3wp.exe/iisexpress.exe is running as.";
254+
errorContext.generalErrorType = "Failed to load .NET Core host";
255+
errorContext.errorReason = "The app was likely published for a different bitness than w3wp.exe/iisexpress.exe is running as.";
256256
throw;
257257
}
258258
{
@@ -302,7 +302,7 @@ try
302302

303303
errorContext.statusCode = 500i16;
304304
errorContext.subStatusCode = 31i16;
305-
errorContext.generalErrorType = "ANCM Failed to Find Native Dependencies";
305+
errorContext.generalErrorType = "Failed to load ASP.NET Core runtime";
306306
errorContext.errorReason = "The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.";
307307

308308
EventLog::Error(
@@ -347,7 +347,7 @@ try
347347
// This only occurs if the request handler isn't referenced by the app, which rarely happens if they are targeting the shared framework.
348348
errorContext.statusCode = 500i16;
349349
errorContext.subStatusCode = 33i16;
350-
errorContext.generalErrorType = "ANCM Request Handler Load Failure";
350+
errorContext.generalErrorType = "Failed to load ASP.NET Core request handler";
351351
errorContext.detailedErrorContent = to_multi_byte_string(format(ASPNETCORE_EVENT_INPROCESS_RH_REFERENCE_MSG, handlerDllPath.empty()
352352
? s_pwzAspnetcoreInProcessRequestHandlerName
353353
: handlerDllPath.c_str()),

src/Servers/IIS/AspNetCoreModuleV2/CommonLib/HostFxrResolver.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ HostFxrResolver::GetHostFxrParameters(
9595
if (!is_regular_file(applicationDllPath))
9696
{
9797
errorContext.subStatusCode = 38;
98-
errorContext.errorReason = "Application DLL not found. Confirm the application dll is present. Single-file deployments are not supported in IIS.";
99-
errorContext.generalErrorType = "ANCM Application DLL Not Found";
100-
errorContext.detailedErrorContent = format("Application DLL was not found at %s.", to_multi_byte_string(applicationDllPath, CP_UTF8).c_str());
98+
errorContext.errorReason = "The app couldn't be found. Confirm the app's main DLL is present. Single-file deployments are not supported in IIS.";
99+
errorContext.generalErrorType = "Failed to locate ASP.NET Core app";
100+
errorContext.detailedErrorContent = format("Application was not found at %s.", to_multi_byte_string(applicationDllPath, CP_UTF8).c_str());
101101
throw InvalidOperationException(
102-
format(L"Application DLL was not found at %s. Confirm the application dll is present. Single-file deployments are not supported in IIS.",
102+
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.",
103103
applicationDllPath.c_str()));
104104
}
105105

src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/dllmain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ CreateApplication(
125125
ErrorContext errorContext;
126126
errorContext.statusCode = 500;
127127
errorContext.subStatusCode = 30;
128-
errorContext.generalErrorType = "ANCM In-Process Start Failure";
129-
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>";
128+
errorContext.generalErrorType = "ASP.NET Core app failed to start";
129+
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>";
130130

131131
if (!FAILED_LOG(hr = IN_PROCESS_APPLICATION::Start(*pServer, pSite, *pHttpApplication, pParameters, nParameters, inProcessApplication, errorContext)))
132132
{

src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ IN_PROCESS_APPLICATION::LoadManagedApplication(ErrorContext& errorContext)
165165
// If server wasn't initialized in time shut application down without waiting for CLR thread to exit
166166
errorContext.statusCode = 500;
167167
errorContext.subStatusCode = 37;
168-
errorContext.generalErrorType = "ANCM Failed to Start Within Startup Time Limit";
169-
errorContext.errorReason = format("ANCM failed to start after %d milliseconds", m_pConfig->QueryStartupTimeLimitInMS());
168+
errorContext.generalErrorType = "ASP.NET Core app failed to start within startup time limit";
169+
errorContext.errorReason = format("ASP.NET Core app failed to start after %d milliseconds", m_pConfig->QueryStartupTimeLimitInMS());
170170

171171
m_waitForShutdown = false;
172172
StopClr();

src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/ErrorPagesTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public async Task IncludesAdditionalErrorPageTextInProcessHandlerLoadFailure_Cor
3131
StopServer();
3232

3333
var responseString = await response.Content.ReadAsStringAsync();
34-
Assert.Contains("HTTP Error 500.0 - ANCM In-Process Handler Load Failure", responseString);
34+
Assert.Contains("500.0", responseString);
3535
VerifyNoExtraTrailingBytes(responseString);
3636

3737
await AssertLink(response);
@@ -71,7 +71,7 @@ public async Task IncludesAdditionalErrorPageTextOutOfProcessHandlerLoadFailure_
7171
StopServer();
7272

7373
var responseString = await response.Content.ReadAsStringAsync();
74-
Assert.Contains("HTTP Error 500.0 - ANCM Out-Of-Process Handler Load Failure", responseString);
74+
Assert.Contains("500.0", responseString);
7575
VerifyNoExtraTrailingBytes(responseString);
7676

7777
await AssertLink(response);
@@ -94,7 +94,7 @@ public async Task IncludesAdditionalErrorPageTextInProcessStartupFailure_Correct
9494
StopServer();
9595

9696
var responseString = await response.Content.ReadAsStringAsync();
97-
Assert.Contains("HTTP Error 500.30 - ANCM In-Process Start Failure", responseString);
97+
Assert.Contains("500.30", responseString);
9898
VerifyNoExtraTrailingBytes(responseString);
9999

100100
await AssertLink(response);

src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupExceptionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public async Task Gets500_30_ErrorPage()
9191
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
9292

9393
var responseText = await response.Content.ReadAsStringAsync();
94-
Assert.Contains("500.30 - ANCM In-Process Start Failure", responseText);
94+
Assert.Contains("500.30", responseText);
9595
}
9696
}
9797
}

src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,14 @@ public async Task InvalidProcessPath_ExpectServerError(string path, string argum
6262
StopServer();
6363

6464
EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.UnableToStart(deploymentResult, subError), Logger);
65-
66-
Assert.Contains("HTTP Error 500.0 - ANCM In-Process Handler Load Failure", await response.Content.ReadAsStringAsync());
65+
if (DeployerSelector.HasNewShim)
66+
{
67+
Assert.Contains("500.0", await response.Content.ReadAsStringAsync());
68+
}
69+
else
70+
{
71+
Assert.Contains("500.0", await response.Content.ReadAsStringAsync());
72+
}
6773
}
6874

6975
[ConditionalFact]
@@ -271,7 +277,7 @@ public async Task RemoveHostfxrFromApp_InProcessHostfxrAPIAbsent()
271277

272278
if (DeployerSelector.HasNewShim)
273279
{
274-
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.32 - ANCM Failed to Load dll");
280+
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.32");
275281
}
276282
else
277283
{
@@ -314,11 +320,11 @@ public async Task PublishWithWrongBitness()
314320

315321
if (DeployerSelector.HasNewShim)
316322
{
317-
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.32 - ANCM Failed to Load dll");
323+
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.32");
318324
}
319325
else
320326
{
321-
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.0 - ANCM In-Process Handler Load Failure");
327+
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.0");
322328
}
323329
}
324330

@@ -335,7 +341,7 @@ public async Task RemoveHostfxrFromApp_InProcessHostfxrLoadFailure()
335341

336342
if (DeployerSelector.HasNewShim)
337343
{
338-
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.32 - ANCM Failed to Load dll");
344+
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.32");
339345
}
340346
else
341347
{
@@ -354,7 +360,7 @@ public async Task TargedDifferenceSharedFramework_FailedToFindNativeDependencies
354360
Helpers.ModifyFrameworkVersionInRuntimeConfig(deploymentResult);
355361
if (DeployerSelector.HasNewShim)
356362
{
357-
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.31 - ANCM Failed to Find Native Dependencies");
363+
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.31");
358364
}
359365
else
360366
{
@@ -374,7 +380,7 @@ public async Task SingleExecutable_FailedToFindNativeDependencies()
374380
File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"));
375381
if (DeployerSelector.HasNewShim)
376382
{
377-
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.38 - ANCM Application DLL Not Found");
383+
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.38");
378384
}
379385
else
380386
{
@@ -396,7 +402,7 @@ public async Task TargedDifferenceSharedFramework_FailedToFindNativeDependencies
396402

397403
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
398404
var responseContent = await response.Content.ReadAsStringAsync();
399-
Assert.Contains("HTTP Error 500.31 - ANCM Failed to Find Native Dependencies", responseContent);
405+
Assert.Contains("500.31", responseContent);
400406
Assert.Contains("The framework 'Microsoft.NETCore.App', version '2.9.9'", responseContent);
401407
}
402408
else
@@ -416,14 +422,14 @@ public async Task RemoveInProcessReference_FailedToFindRequestHandler()
416422

417423
if (DeployerSelector.HasNewShim && DeployerSelector.HasNewHandler)
418424
{
419-
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.33 - ANCM Request Handler Load Failure ");
425+
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.33");
420426

421427
EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessFailedToFindRequestHandler(deploymentResult), Logger);
422428
}
423429
else if (DeployerSelector.HasNewShim)
424430
{
425431
// Forwards compat tests fail earlier due to a error with the M.AspNetCore.Server.IIS package.
426-
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.31 - ANCM Failed to Find Native Dependencies");
432+
await AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.31");
427433

428434
EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessFailedToFindNativeDependencies(deploymentResult), Logger);
429435
}
@@ -462,7 +468,7 @@ public async Task StartupTimeoutIsApplied()
462468
if (DeployerSelector.HasNewHandler)
463469
{
464470
var responseContent = await response.Content.ReadAsStringAsync();
465-
Assert.Contains("ANCM Failed to Start Within Startup Time Limit", responseContent);
471+
Assert.Contains("500.37", responseContent);
466472
}
467473
}
468474
}
@@ -765,7 +771,6 @@ public async Task ExceptionIsLoggedToEventLogAndPutInResponseDuringHostingStartu
765771
Assert.Contains("InvalidOperationException", content);
766772
Assert.Contains("TestSite.Program.Main", content);
767773
Assert.Contains("From Configure", content);
768-
Assert.DoesNotContain("ANCM In-Process Start Failure", content);
769774

770775
StopServer();
771776

@@ -932,7 +937,7 @@ private static void MoveApplication(
932937

933938
private Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult)
934939
{
935-
return AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "HTTP Error 500.0 - ANCM In-Process Handler Load Failure");
940+
return AssertSiteFailsToStartWithInProcessStaticContent(deploymentResult, "500.0");
936941
}
937942

938943
private async Task AssertSiteFailsToStartWithInProcessStaticContent(IISDeploymentResult deploymentResult, string error)

src/Servers/IIS/IIS/test/Common.FunctionalTests/MultiApplicationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public async Task FailsAndLogsWhenRunningTwoInProcessApps()
5050

5151
if (DeployerSelector.HasNewShim)
5252
{
53-
Assert.Contains("500.35 - ANCM Multiple In-Process Applications in same Process", await result2.Content.ReadAsStringAsync());
53+
Assert.Contains("500.35", await result2.Content.ReadAsStringAsync());
5454
}
5555

5656
EventLogHelpers.VerifyEventLogEvent(result, EventLogHelpers.OnlyOneAppPerAppPool(), Logger);
@@ -77,7 +77,7 @@ public async Task FailsAndLogsEventLogForMixedHostingModel(HostingModel firstApp
7777

7878
if (DeployerSelector.HasNewShim)
7979
{
80-
Assert.Contains("500.34 - ANCM Mixed Hosting Models Not Supported", await result2.Content.ReadAsStringAsync());
80+
Assert.Contains("500.34", await result2.Content.ReadAsStringAsync());
8181
}
8282

8383
EventLogHelpers.VerifyEventLogEvent(result, "Mixed hosting model is not supported.", Logger);

src/Servers/IIS/IIS/test/Common.FunctionalTests/OutOfProcess/GlobalVersionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public async Task GlobalVersion_NewVersionNumber_Fails(string version)
8383
var response = await deploymentResult.HttpClient.GetAsync(_helloWorldRequest);
8484
Assert.False(response.IsSuccessStatusCode);
8585
var responseString = await response.Content.ReadAsStringAsync();
86-
Assert.Contains("HTTP Error 500.0 - ANCM Out-Of-Process Handler Load Failure", responseString);
86+
Assert.Contains("500.0", responseString);
8787
}
8888

8989
[ConditionalTheory]

0 commit comments

Comments
 (0)