Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当抛出通用异常时,如何从启动类中的 UseDeveloperExceptionPage 内置和生成的格式良好的 HTML 响应中读取 HTML 响应。这样我就可以发送与电子邮件正文相同的异常,就像 Elmah 日志记录通过电子邮件发送异常一样。
请按照以下代码:
https://github.com/aspnet/Diagnostics/tree/master/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage
唯一的方法是使用原始源代码的引用重新构建 html。