For me, the problem was that the app was launched at https://localhost:7065 without the base path. After I added the base path specified in launchSettings.json (e.g., https://localhost:7065/Myapp), it worked.