diff --git a/src/Servers/IIS/IIS/src/StartupHook.cs b/src/Servers/IIS/IIS/src/StartupHook.cs index e913ae7e18fb..2090cb6fb331 100644 --- a/src/Servers/IIS/IIS/src/StartupHook.cs +++ b/src/Servers/IIS/IIS/src/StartupHook.cs @@ -49,8 +49,10 @@ public static void Initialize() var iisConfigData = NativeMethods.HttpGetApplicationProperties(); var contentRoot = iisConfigData.pwzFullApplicationPath.TrimEnd(Path.DirectorySeparatorChar); + using var fileProvider = new PhysicalFileProvider(contentRoot); + var model = ErrorPageModelBuilder.CreateErrorPageModel( - new PhysicalFileProvider(contentRoot), + fileProvider, logger: null, showDetailedErrors: true, exception);