From 20568e6587d7887ba519bca37ad5ffd791f09f67 Mon Sep 17 00:00:00 2001 From: Brian Dukes Date: Fri, 20 Mar 2020 13:21:24 -0500 Subject: [PATCH] Don't re-use MVC controllers Fixes #3634, thanks @DaveMartinSE! Error message states: >If a custom controller factory is in use, make sure that it creates a >new instance of the controller for each request. --- DNN Platform/DotNetNuke.Web.Mvc/Extensions/StartupExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Extensions/StartupExtensions.cs b/DNN Platform/DotNetNuke.Web.Mvc/Extensions/StartupExtensions.cs index db1173ec0db..e61440b9f78 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Extensions/StartupExtensions.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Extensions/StartupExtensions.cs @@ -22,7 +22,7 @@ public static void AddMvcControllers(this IServiceCollection services) ); foreach (var controller in controllerTypes) { - services.TryAddScoped(controller); + services.TryAddTransient(controller); } } }