34 lines
961 B
C#
34 lines
961 B
C#
using System;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
namespace DeveloperExceptionPageSample
|
|
{
|
|
public class Startup
|
|
{
|
|
public void Configure(IApplicationBuilder app)
|
|
{
|
|
app.UseDeveloperExceptionPage();
|
|
app.Run(context =>
|
|
{
|
|
throw new Exception(string.Concat(
|
|
"Demonstration exception. The list:", "\r\n",
|
|
"New Line 1", "\n",
|
|
"New Line 2", Environment.NewLine,
|
|
"New Line 3"));
|
|
});
|
|
}
|
|
|
|
public static void Main(string[] args)
|
|
{
|
|
var host = new WebHostBuilder()
|
|
.UseDefaultHostingConfiguration(args)
|
|
.UseServer("Microsoft.AspNetCore.Server.Kestrel")
|
|
.UseIISPlatformHandlerUrl()
|
|
.UseStartup<Startup>()
|
|
.Build();
|
|
|
|
host.Run();
|
|
}
|
|
}
|
|
} |