Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jonok 297 posts 658 karma points
    Aug 06, 2021 @ 02:14
    jonok
    0

    How to display server errors in Umbraco 9

    Just wondering how I go about displaying errors in the browser (for Umbraco 9), similar to the customerrors web.config setting in previous versions of Umbraco? I am using IIS to run the site.

  • Bjarke Berg 7 posts 130 karma points hq
    Aug 06, 2021 @ 11:26
    Bjarke Berg
    100

    If you use the default template it is configured to only show developer exception pages when running in development

    From the startup.cs:

        /// <summary>
        /// Configures the application
        /// </summary>
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
    

    On a server/IIS you can specify the environment using this environment variable (Can be setup per application pool, IIRC)

    "ASPNETCORE_ENVIRONMENT": "Development"
    

    The value defaults to "Production"

  • jonok 297 posts 658 karma points
    Aug 06, 2021 @ 21:20
    jonok
    0

    Thanks Bjarke! I got it work by adding the environment variable in ApplicationHost.config in the configuration editor in IIS.

    https://stackoverflow.com/questions/31049152/publish-to-iis-setting-environment-variable

Please Sign in or register to post replies

Write your reply to:

Draft