© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
1 reply
iinuwa

❔ Middleware in ASP.NET MVC (not Core)

I have some old applications on ASP.NET MVC 5 and 6, and I want to accomplish something like the automatic TraceId propagation that ASP.NET Core does. (E.g., reading
traceparent
traceparent
from the incoming request and setting the
Activity.Current
Activity.Current
property accordingly.)

I would like to have some middleware that runs before every controller and sets the Activity. To create this middleware, do I need to use OWIN? Or is there something built into ASP.NET MVC that I can use to run code to read the request before it is handed over to the controller methods?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

ASP.NET Core MVC Structure
C#CC# / help
4w ago
✅ ASP.NET Core MVC error
C#CC# / help
3y ago