public void ResetErrorConfiguration() { lock (ConfigurationLock) { var errorConfiguration = new ErrorConfiguration(GetVirtualPath()); errorConfiguration.Reset(); errorConfiguration.Persist(); Delay(); } }
public void WriteErrorConfiguration(ErrorConfigurationView view) { lock (ConfigurationLock) { var errorConfiguration = new ErrorConfiguration(GetVirtualPath()); errorConfiguration.Read(); errorConfiguration.CustomErrors.UpdateSection( view.CustomErrorsMode, view.CustomErrorsRedirectMode, view.CustomErrorsNotFoundErrorRedirect, view.CustomErrorsForbiddenErrorRedirect, view.CustomErrorsServerErrorRedirect); errorConfiguration.HttpRuntime.UpdateSection( view.RelaxedUrlToFileSystemMappingMode); errorConfiguration.HttpErrors.UpdateSection( view.HttpErrorsMode, view.HttpErrorsExistingResponseMode, view.HttpErrorsNotFoundErrorRedirect, view.HttpErrorsForbiddenErrorRedirect, view.HttpErrorsServerErrorRedirect); errorConfiguration.AppSettingsWriter.UpdateSettings( view.ErrorTriggerLinkOpenMode, view.ManualServerErrorHandlingMode, view.TrySkipIisCustomErrorsMode, view.ErrorPageRenderingMode, view.ErrorPageExceptionsMode, view.ManualNotFoundErrorHandlingMode, view.ManualErrorsRenderingMode); errorConfiguration.Persist(); Delay(); } }