-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Display startup errors in ANCM #8518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👀 |
I'll be taking this over eventually, but we still need some downstream dependencies. |
src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/StartupExceptionApplication.h
Outdated
Show resolved
Hide resolved
I have a prototype of this using replicating the hosting exception page. Currently looks like: As @pakrym mentioned, this unfortunately brings in some dependencies that will be present in every inproc app. Here are the usings I have for the startup hook. using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.Encodings.Web;
using Microsoft.AspNetCore.Server.IIS;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Primitives;
using Microsoft.Extensions.StackTrace.Sources; |
Hosting already has all of those dependencies, no? You wouldn't be adding anything new. |
bcbb8af
to
feed9f0
Compare
149aa61
to
7cafe21
Compare
{ | ||
} | ||
|
||
ServerErrorHandler(IHttpContext& pContext, USHORT statusCode, USHORT subStatusCode, std::string statusText, HRESULT hr, HINSTANCE module, bool disableStartupPage, int page) noexcept |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two scenarios here. One which loads from a resource file (page number passed in) and the other is passed in via the startup hook. I have a 3rd constructor which takes both.
|
||
AppDomain.CurrentDomain.UnhandledException += (sender, eventArgs) => | ||
{ | ||
var exception = (Exception)eventArgs.ExceptionObject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp
Outdated
Show resolved
Hide resolved
src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp
Outdated
Show resolved
Hide resolved
src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/managedexports.cpp
Outdated
Show resolved
Hide resolved
I'm going to try verifying this change E2E ASAP. I'm confident in the change, but I would like to make sure this works as part of the SDK. |
c399ee2
to
6ea8496
Compare
No description provided.