Skip to content

Commit 10d6f49

Browse files
Consolidate error pages used by ANCM and improve link (#43170)
1 parent 0c9eb33 commit 10d6f49

17 files changed

+30
-277
lines changed

src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/AspNetCore.vcxproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,7 @@
8585
<ResourceCompile Include="HtmlResponses.rc" />
8686
</ItemGroup>
8787
<ItemGroup>
88-
<None Include="InProcessShimStaticHtml.htm">
89-
<DeploymentContent>true</DeploymentContent>
90-
</None>
91-
<None Include="OutOfProcessShimStaticHtml.htm">
88+
<None Include="ancm_error_page.htm">
9289
<DeploymentContent>true</DeploymentContent>
9390
</None>
9491
</ItemGroup>
Binary file not shown.

src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/OutOfProcessShimStaticHtml.htm

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/InProcessShimStaticHtml.htm renamed to src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/ancm_error_page.htm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,15 @@ <h1> HTTP Error %d.%d - %s </h1>
6565
%s
6666

6767
<h2> Troubleshooting steps: </h2>
68-
6968
<ul>
7069
<li> Check the system event log for error messages </li>
7170
<li> Enable logging the application process' stdout messages </li>
7271
<li> Attach a debugger to the application process and inspect </li>
7372
</ul>
7473

7574
<h2>
76-
For more information visit:
77-
%s <a href="https://go.microsoft.com/fwlink/?LinkID=2028526"> <cite> https://go.microsoft.com/fwlink/?LinkID=2028526 </cite> </a>
75+
For more guidance on diagnosing and handling these errors, visit
76+
%s <a href="https://go.microsoft.com/fwlink/?LinkID=2028526"> <cite>Troubleshoot ASP.NET Core on Azure App Service and IIS</cite></a>.
7877
</h2>
7978
</body>
8079
</html>

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ APPLICATION_INFO::CreateApplication(IHttpContext& pHttpContext)
113113
pHttpApplication.GetApplicationId(),
114114
hr);
115115

116-
auto page = options.QueryHostingModel() == HOSTING_IN_PROCESS ? IN_PROCESS_SHIM_STATIC_HTML : OUT_OF_PROCESS_SHIM_STATIC_HTML;
116+
auto page = ANCM_ERROR_PAGE;
117117
std::string responseContent;
118118
if (options.QueryShowDetailedErrors())
119119
{
@@ -253,22 +253,22 @@ APPLICATION_INFO::ShutDownApplication(const bool fServerInitiated)
253253

254254
/* Overview of shadow copy logic when enabled. See https://github.com/dotnet/aspnetcore/pull/28357 for more context
255255
256-
* On first request, ANCM goes through its startup sequence, starting dotnet and sending the request into managed code. During this sequence,
256+
* On first request, ANCM goes through its startup sequence, starting dotnet and sending the request into managed code. During this sequence,
257257
* ANCM will copy the contents of the app directory to another directory which is user specified. The path to this directory can be absolute or relative.
258258
259-
* Logs and log files will be written to the app directory rather than the shadow copy directory. app_offline will also only be watched in the app directory.
259+
* Logs and log files will be written to the app directory rather than the shadow copy directory. app_offline will also only be watched in the app directory.
260260
* The current directory will be set to the app directory as well as the AppContext.BaseDirectory.
261261
262-
* On publish of new content to the app directory, ANCM will start debouncing file change notifications for dlls, waiting for a steady state.
263-
* This is done by resetting a timer each time a dll is changed, eventually triggering the timer once there are no dll changes. Afterwards, shutdown is started,
262+
* On publish of new content to the app directory, ANCM will start debouncing file change notifications for dlls, waiting for a steady state.
263+
* This is done by resetting a timer each time a dll is changed, eventually triggering the timer once there are no dll changes. Afterwards, shutdown is started,
264264
* causing the process to recycle.
265265
266-
* Subfolders are created under the user specified shadowCopyDirectory, where the highest int value directory name will be used each time.
267-
* It will start at subdirectory with name '0' and increment from there. On shutdown, because dlls are still locked by the running process,
268-
* we need to copy dlls to a different directory than what is currently running in the app. So in the case where the directory name is '0',
266+
* Subfolders are created under the user specified shadowCopyDirectory, where the highest int value directory name will be used each time.
267+
* It will start at subdirectory with name '0' and increment from there. On shutdown, because dlls are still locked by the running process,
268+
* we need to copy dlls to a different directory than what is currently running in the app. So in the case where the directory name is '0',
269269
* we will create a directory name '1' and write the contents there. Then on app start, it will pick the directory name '1' as it's the highest value.
270270
271-
* Other directories in the shadow copy directory will be cleaned up as well. Following the example, after '1' has been selected as the directory to use,
271+
* Other directories in the shadow copy directory will be cleaned up as well. Following the example, after '1' has been selected as the directory to use,
272272
* we will start a thread that deletes all other folders in that directory.
273273
*/
274274
std::filesystem::path

src/Servers/IIS/AspNetCoreModuleV2/AspNetCore/resource.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
// Microsoft Visual C++ generated include file.
33
// Used by HtmlResponses.rc
44
//
5-
#define IN_PROCESS_SHIM_STATIC_HTML 101
6-
#define OUT_OF_PROCESS_SHIM_STATIC_HTML 102
7-
#define UNKNOWN_HOSTING_STATIC_HTML 103
5+
#define ANCM_ERROR_PAGE 101
86

97

108
// Next default values for new objects
11-
//
9+
//
1210
#ifdef APSTUDIO_INVOKED
1311
#ifndef APSTUDIO_READONLY_SYMBOLS
1412
#define _APS_NEXT_RESOURCE_VALUE 104

src/Servers/IIS/AspNetCoreModuleV2/CommonLib/file_utility.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ class FILE_UTILITY
2828

2929
static
3030
std::string
31-
GetHtml(HMODULE module, int page, USHORT statusCode, USHORT subStatusCode, const std::string& speicificReasonPhrase, const std::string& solution);
31+
GetHtml(HMODULE module, int page, USHORT statusCode, USHORT subStatusCode, const std::string& specificReasonPhrase, const std::string& solution);
3232

3333
static
3434
std::string
35-
GetHtml(HMODULE module, int page, USHORT statusCode, USHORT subStatusCode, const std::string& speicificReasonPhrase, const std::string& solution, const std::string& error);
35+
GetHtml(HMODULE module, int page, USHORT statusCode, USHORT subStatusCode, const std::string& specificReasonPhrase, const std::string& solution, const std::string& error);
3636

3737
private:
38+
3839
static
3940
HRESULT
4041
IsPathUnc(
4142
__in LPCWSTR pszPath,
4243
__out BOOL * pfIsUnc
4344
);
44-
4545
};
4646

src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/HtmlResponses.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
2424
// TEXTINCLUDE
2525
//
2626

27-
1 TEXTINCLUDE
27+
1 TEXTINCLUDE
2828
BEGIN
2929
"resource.h\0"
3030
END
3131

32-
2 TEXTINCLUDE
32+
2 TEXTINCLUDE
3333
BEGIN
3434
"#include ""winres.h""\r\n"
3535
"\0"
3636
END
3737

38-
3 TEXTINCLUDE
38+
3 TEXTINCLUDE
3939
BEGIN
4040
"\r\n"
4141
"\0"
@@ -49,7 +49,7 @@ END
4949
// HTML
5050
//
5151

52-
IN_PROCESS_RH_STATIC_HTML HTML "InProcessRhStaticHtml.htm"
52+
ANCM_ERROR_PAGE HTML "..\\..\\AspNetCoreModuleV2\\AspNetCore\\ancm_error_page.htm"
5353

5454
#endif // English (United States) resources
5555
/////////////////////////////////////////////////////////////////////////////

src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/InProcessRequestHandler.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
<ResourceCompile Include="inprocessrequesthandler.rc" />
6060
</ItemGroup>
6161
<ItemGroup>
62-
<None Include="InProcessRhStaticHtml.htm">
62+
<None Include="..\..\AspNetCore\ancm_error_page.htm">
6363
<DeploymentContent>true</DeploymentContent>
6464
</None>
6565
<None Include="Source.def" />

src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/InProcessRhStaticHtml.htm

Lines changed: 0 additions & 80 deletions
This file was deleted.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,11 @@ CreateApplication(
140140
auto content = !g_errorPageContent.empty() ?
141141
g_errorPageContent :
142142
FILE_UTILITY::GetHtml(g_hServerModule,
143-
IN_PROCESS_RH_STATIC_HTML,
143+
ANCM_ERROR_PAGE,
144144
errorContext.statusCode,
145145
errorContext.subStatusCode,
146146
errorContext.generalErrorType,
147-
errorContext.errorReason,
148-
"");
147+
errorContext.errorReason);
149148

150149
auto pErrorApplication = std::make_unique<StartupExceptionApplication>(*pServer,
151150
*pHttpApplication,

src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/resource.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// Microsoft Visual C++ generated include file.
33
// Used by HtmlResponses.rc
44
//
5-
#define IN_PROCESS_RH_STATIC_HTML 101
5+
#define ANCM_ERROR_PAGE 101
66

77
// Next default values for new objects
8-
//
8+
//
99
#ifdef APSTUDIO_INVOKED
1010
#ifndef APSTUDIO_READONLY_SYMBOLS
1111
#define _APS_NEXT_RESOURCE_VALUE 102

src/Servers/IIS/AspNetCoreModuleV2/OutOfProcessRequestHandler/HtmlResponses.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ END
4949
// HTML
5050
//
5151

52-
OUT_OF_PROCESS_RH_STATIC_HTML HTML "OutOfProcessRhStaticHtml.htm"
52+
ANCM_ERROR_PAGE HTML "..\\..\\AspNetCoreModuleV2\\AspNetCore\\ancm_error_page.htm"
5353

5454
#endif // English (United States) resources
5555
/////////////////////////////////////////////////////////////////////////////

src/Servers/IIS/AspNetCoreModuleV2/OutOfProcessRequestHandler/OutOfProcessRequestHandler.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<ResourceCompile Include="outofprocessrequesthandler.rc" />
6969
</ItemGroup>
7070
<ItemGroup>
71-
<None Include="OutOfProcessRhStaticHtml.htm">
71+
<None Include="..\..\AspNetCore\ancm_error_page.htm">
7272
<DeploymentContent>true</DeploymentContent>
7373
</None>
7474
<None Include="Source.def" />

0 commit comments

Comments
 (0)