From b3db92ee957ab7454bb96f934d4db9b8e84b7b93 Mon Sep 17 00:00:00 2001 From: hishamco Date: Fri, 9 Oct 2020 19:17:42 +0300 Subject: [PATCH] Add blazor error details on DEV environment --- Oqtane.Server/Startup.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Oqtane.Server/Startup.cs b/Oqtane.Server/Startup.cs index 396e6602..976556b7 100644 --- a/Oqtane.Server/Startup.cs +++ b/Oqtane.Server/Startup.cs @@ -32,6 +32,7 @@ namespace Oqtane private string _webRoot; private Runtime _runtime; private bool _useSwagger; + private IWebHostEnvironment _env; public IConfigurationRoot Configuration { get; } @@ -49,6 +50,8 @@ namespace Oqtane _webRoot = env.WebRootPath; AppDomain.CurrentDomain.SetData("DataDirectory", Path.Combine(env.ContentRootPath, "Data")); + + _env = env; } // This method gets called by the runtime. Use this method to add services to the container. @@ -58,7 +61,13 @@ namespace Oqtane // Register localization services services.AddLocalization(options => options.ResourcesPath = "Resources"); - services.AddServerSideBlazor(); + services.AddServerSideBlazor().AddCircuitOptions(options => + { + if (_env.IsDevelopment()) + { + options.DetailedErrors = true; + } + }); // setup HttpClient for server side in a client side compatible fashion ( with auth cookie ) if (!services.Any(x => x.ServiceType == typeof(HttpClient)))