System.InvalidOperationException: 'A path base can only be configured using IApplicationBuilder.UsePathBase().' [duplicate] System.InvalidOperationException: 'A path base can only be configured using IApplicationBuilder.UsePathBase().' [duplicate] docker docker

System.InvalidOperationException: 'A path base can only be configured using IApplicationBuilder.UsePathBase().' [duplicate]


I was setting the relative path within applicationUrl in launchSettings.json which was causing the error:

"applicationUrl": "https://localhost:5001/admin",

I changed that back to the root URL and instead added a launchUrl with the path which fixed the error and launched the path I wanted on start:

"applicationUrl": "https://localhost:5001","launchUrl": "admin"