In ASP.net Core the following code inserts bookmarks into a Word document using Syncfusion and then exports the Word doc in the browser. This works well when the project is debugged but does not work after the project is published on Azure.
The error below is shown on the web page:
An error occurred while processing your request.
Swapping to Development environment will display more detailed information about the error that occurred.
Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
How can I test the code once published on Azure?
Set the DOTNET_ENVIRONMENT and ASPNETCORE_ENVIRONMENT to Production when you deploy it.
- Microsoft Docs > ASP.NET Core > Fundamentals > Environments (dev, stage, prod) > Use multiple environments in ASP.NET Core