0

I'm implementing profiler to track http requests coming to .net core applications hosted in IIS. I'm using coreclr profiling api to hook method enter/exit.

Which method I should track to know a new http request coming into my application.

Zader
  • 67
  • 7

1 Answers1

0

Create a middle ware and configure ASP.NET Core to use it. It should receive requests, process it, then pass it along with the pipeline.

For more information see here: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-2.2

Afshar Mohebi
  • 10,479
  • 17
  • 82
  • 126
  • Thanks. To configure middleware I need to add it in startup.cs , right? But I don't want to touch my .net core application code. Is there any default middleware available in .net core applications which will be always executed. So that I can track it? – Zader Jul 20 '19 at 19:39
  • Do you mean an already available middle ware which monitor requests and is extensible too? I do not know a case by the moment, but I am pretty sure that there a bunch of them available on the nugget. – Afshar Mohebi Jul 21 '19 at 04:33
  • Sorry, I think my question was not clear. Do dotnet applications run any middleware by default. So that we no need to configure it manually in statup. I can see usemvc middleware in .net core web application. Is this usemvc middleware mandatory to run .net core web applications. If no, Is there any middleware which must be always used in .net core web application? – Zader Jul 21 '19 at 13:06
  • I am not sure about the answer, sorry. – Afshar Mohebi Jul 21 '19 at 18:03