I am working on a Blazor WebAssembly application .Net 6 and have encountered a peculiar behavior regarding the display of exception details. While in my local development environment, I can see complete details of exceptions, including file path and line number, this is not the case when the application is published on Azure Static Web Apps.
Local Environment:
Azure Static Web App Environment:
This is by design, you don't get line numbers in optimised code, even in ASP.Net Razor, MVC or Web API.
That is the difference, to publish to Azure you are most likely using the default Release build configuration. You can get the same experience locally by switching the build configuration to Release.
Welcome to .Net!