❔ Help with ASP.NET startup

I needed to understand how the initialization of the ASP.NET web application occurs and how the internal workings of it occur. Any resource or documentation about it would be helpful or even answers.
7 Replies
Keswiik
Keswiik2y ago
App startup in ASP.NET Core
Learn how the Startup class in ASP.NET Core configures services and the app's request pipeline.
ANewDeveloper
ANewDeveloperOP2y ago
I wanted to gain a deeper understanding on how the ASP.NET application starts all the way from a console application and then gets converted into the web application/API and how it happens on a low level.
Pobiega
Pobiega2y ago
there is no "conversion" its always a console app, it just that the console doesnt take any input - it just "runs" the ASP.NET host sounds more like you want to understand the request pipeline and ASP internals, such as routing etc
ANewDeveloper
ANewDeveloperOP2y ago
Kind of yea, is there any place where i could read up on it, or would i just need to dive into the ASP.NET code on github
Pobiega
Pobiega2y ago
ASP.NET Core fundamentals overview
Learn the fundamental concepts for building ASP.NET Core apps, including dependency injection (DI), configuration, middleware, and more.
Pobiega
Pobiega2y ago
the middleware section will be important the asp pipeline is quite simple at its core. a request comes in, this creates a new HttpContext filled with information from the request. it then starts the pipeline, triggering each middleware in turn. a middleware is essentially a function that calls the next function.
private readonly RequestDelegate _next;

public async Task InvokeAsync(HttpContext context)
{
// you can run code before the next handler (before the response)
await _next(context);
// or you can run code after that entire chain has ended (after the response)
}
private readonly RequestDelegate _next;

public async Task InvokeAsync(HttpContext context)
{
// you can run code before the next handler (before the response)
await _next(context);
// or you can run code after that entire chain has ended (after the response)
}
you can make your own middleware, but there are a ton already included with ASP.NET - including routing, executing controllers or other request handlers, etc.
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server