#StackBounty: #c# #asp.net #asp.net-mvc #asp.net-core #asp.net-core-middleware How to handle dynamic error pages in .net MVC Core?

Bounty: 50

Currently I have


I want to make the path relative to the original path.

For example if

Tenant1/PageThatThrowsError then

but if

Tenant2/PageThatThrowsError then

I thought I would be able to do

    new ExceptionHandlerOptions
        ExceptionHandler = async (ctx) =>
            //logic that extracts tenant
            ctx.Request.Path = new PathString(Invariant($"{tenant}/Home/Error"));

but this throws a 500

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.