Try our conversational search powered by Generative AI!

Class Settings

Holds the instances of all Site Settings configurations which are in the WebConfig file.

Inheritance
System.Object
Settings
Namespace: EPiServer.Configuration
Assembly: EPiServer.Configuration.dll
Version: 11.20.7
Syntax
[ServiceConfiguration(FactoryMember = "Instance")]
public class Settings : ConfigurationElementBase
Remarks

The Settings class contains information about site settings configuration. This includes the current instance of site settings configuration via (Instance) and all sites settings configuration via (ALL).

The Settings class has the fallback host, which is indicates with "*" in the web.config file for an enterprise solution.

Constructors

Settings()

Initializes a new instance of the Settings class.

Declaration
public Settings()

Properties

ActivityArchiveRetentionPeriod

Set to the number of months that activities should remain archived before they are deleted. A value of zero (0) indicates that activities should be deleted immediately. A value of -1 indicates that activities should remain indefinitely.

Declaration
public int ActivityArchiveRetentionPeriod { get; set; }
Property Value
Type Description
System.Int32

BackgroundCopyThreshold

Gets or sets the background copy threshold. If a copy operation is requested with a larger number of pages than threshold then the copy is performed in a background thread.

Declaration
public int BackgroundCopyThreshold { get; set; }
Property Value
Type Description
System.Int32

The background copy threshold.

ContentVersionCacheSlidingExpiration

The sliding cache for how long a content version is cached. Set to "0:0:0" to disable.

Declaration
[TimeSpanValidator]
public TimeSpan ContentVersionCacheSlidingExpiration { get; set; }
Property Value
Type Description
System.TimeSpan

DefaultNotificationEmailAddress

System default email address for no reply emails

Declaration
public string DefaultNotificationEmailAddress { get; set; }
Property Value
Type Description
System.String

DefaultNotificationEmailDisplayName

System default sender name for no reply emails

Declaration
public string DefaultNotificationEmailDisplayName { get; set; }
Property Value
Type Description
System.String

DisableVersionDeletion

Defines if the user interface should disable tools to increase traceability.

Declaration
[BoolValidator]
public bool DisableVersionDeletion { get; set; }
Property Value
Type Description
System.Boolean

EnableLogOfContentSave

Gets or sets a value indicating whether metadata about save operation of content items should be logged to Activity Log.

Declaration
[BoolValidator]
public bool EnableLogOfContentSave { get; set; }
Property Value
Type Description
System.Boolean
Remarks

If value is set to true all save operations will be logged meaning alot more entries will be stored in activity log in database. It is recommended to have scheduled truncation job for activity log enabled and configured to run periodically.

If value is false mirroring will not include changes for unpublished content

EnableModelSyncCommit

Set to false to disable the commit phase when synchronizing typed models. Block types and page types will not be updated automatically.

Declaration
[BoolValidator]
public bool EnableModelSyncCommit { get; set; }
Property Value
Type Description
System.Boolean

EnablePerformanceCounters

Defines if performance counter data should be collected.

Declaration
[BoolValidator]
public bool EnablePerformanceCounters { get; set; }
Property Value
Type Description
System.Boolean

EnableSavingOfConfigurationToDatabase

Gets or sets a value indicating whether the configuration should be saved to database.

Declaration
[BoolValidator]
public bool EnableSavingOfConfigurationToDatabase { get; set; }
Property Value
Type Description
System.Boolean

true if the configuration should be saved to database; otherwise, false.

Remarks

The mirroring service requires that the configruation is saved to database and therefore if the site is to be mirrored to or from the setting must be set to true.

EnableScheduler

Set to false to disable EPiServer's connection with the scheduler. Default value (if the tag does not exist) is true.

Declaration
[BoolValidator]
public bool EnableScheduler { get; set; }
Property Value
Type Description
System.Boolean

EnableSemanticVersioning

NOTE: This is a pre-release API that is UNSTABLE and might not satisfy the compatibility requirements as denoted by its associated normal version. Set to true to enable semantic versioning of models.

Declaration
[BoolValidator]
public bool EnableSemanticVersioning { get; set; }
Property Value
Type Description
System.Boolean

ExpirationNotificationPeriod

The amount of time before a contents expiration date that the expiration warning should become visible.

Declaration
[TimeSpanValidator]
public TimeSpan ExpirationNotificationPeriod { get; set; }
Property Value
Type Description
System.TimeSpan

GlobalErrorHandling

Set whether you want to use EPiServer's error handling.

Declaration
public string GlobalErrorHandling { get; set; }
Property Value
Type Description
System.String

GoogleMapsApiV3Url

Gets or sets the URL for Google Maps API v3

Declaration
public string GoogleMapsApiV3Url { get; set; }
Property Value
Type Description
System.String

The URL for Google Maps API v3, possibly site-specific.

HttpCacheability

Value to set the HttpCacheability enumeration for the cach.

Declaration
public HttpCacheability HttpCacheability { get; set; }
Property Value
Type Description
System.Web.HttpCacheability

HttpCacheExpiration

Value to set the number of seconds a page should be cached.

Declaration
[TimeSpanValidator]
public TimeSpan HttpCacheExpiration { get; set; }
Property Value
Type Description
System.TimeSpan

HttpCacheVaryByCustom

Specifies a custom text string to vary cached output responses by. Passed to Response.Cache.SetVaryByCustom.

Declaration
public string HttpCacheVaryByCustom { get; set; }
Property Value
Type Description
System.String

HttpCacheVaryByParams

The parameters to the page (i.e. querystring) that the cache should vary by. Forwarded to Response.Cache.SetVaryByParams.

Declaration
public string[] HttpCacheVaryByParams { get; set; }
Property Value
Type Description
System.String[]

IISHiddenSegments

Defines IIS' hidden segments in comma separated format.

Declaration
public string IISHiddenSegments { get; set; }
Property Value
Type Description
System.String

Instance

Get the current configuration settings.

Declaration
public static Settings Instance { get; set; }
Property Value
Type Description
Settings

MaxContentsPerDatabaseRequest

Gets or sets the number of contents when contents requested from database.

Declaration
public int MaxContentsPerDatabaseRequest { get; set; }
Property Value
Type Description
System.Int32

MirroringMonitoringMaxDataPerJob

Declaration
public int MirroringMonitoringMaxDataPerJob { get; set; }
Property Value
Type Description
System.Int32

MirroringSource

The endpoint to use when communicating with mirroring server

Declaration
public string MirroringSource { get; set; }
Property Value
Type Description
System.String

MonitoredTaskTruncateLimit

The amount of time before a monitored task will be removed.

Declaration
[TimeSpanValidator]
public TimeSpan MonitoredTaskTruncateLimit { get; set; }
Property Value
Type Description
System.TimeSpan

OperationCompatibility

Gets or sets the operation compatibility. Default value is None.

Declaration
public EPiServerCompatibility OperationCompatibility { get; set; }
Property Value
Type Description
EPiServerCompatibility

The operation compatibility.

Remarks

See EPiServerCompatibility for details on the individual values.

PageCacheSlidingExpiration

The page cache interval (in hours) for the local database. Set to "0" to disable.

Declaration
[TimeSpanValidator]
public TimeSpan PageCacheSlidingExpiration { get; set; }
Property Value
Type Description
System.TimeSpan

PageFolderVirtualPathProviderName

Name for the VirtualPathProvider that is responsible for handling of page folders

Declaration
[CustomRegexStringValidator("^[a-zA-Z0-9]{1,255}$", "The string must be a combination of alphanumericals, dots (.) and dashes (-) up to 256 characters long, e.g. 'site.com' or 'MySite-2'.")]
public string PageFolderVirtualPathProviderName { get; set; }
Property Value
Type Description
System.String

PageUseBrowserLanguagePreferences

Determines if the browser language should define which language is used

Declaration
[BoolValidator]
public bool PageUseBrowserLanguagePreferences { get; set; }
Property Value
Type Description
System.Boolean

PageValidateTemplate

Sets if the current template has to match the page type template

Declaration
[BoolValidator]
public bool PageValidateTemplate { get; set; }
Property Value
Type Description
System.Boolean

PermanentEditRetainPeriod

Gets or sets the retain period for the page's "permanent edit" status.

Declaration
[TimeSpanValidator]
public TimeSpan PermanentEditRetainPeriod { get; set; }
Property Value
Type Description
System.TimeSpan

The retain period.

RemoteInvalidateVersionChanges

Set to true to force remote invalidation of cache of specific versions. This is can be used when there are load balanced editor servers and changes to a specific version should be immediately seen. Otherwise it is controlled by ContentVersionCacheSlidingExpiration.

Declaration
[BoolValidator]
public bool RemoteInvalidateVersionChanges { get; set; }
Property Value
Type Description
System.Boolean

RemotePageCacheSlidingExpiration

The page cache intervals (in hours) for remote sites. Set to "0" to disable.

Declaration
[TimeSpanValidator]
public TimeSpan RemotePageCacheSlidingExpiration { get; set; }
Property Value
Type Description
System.TimeSpan

RemoteWebServiceCulture

Set the System.Threading.Thread.CurrentThread.CurrentCulture if handling pages remote.

Declaration
public int RemoteWebServiceCulture { get; set; }
Property Value
Type Description
System.Int32

SgmlParserDecodeCharEntities

Defines whether SgmlParser should decode character entities (like " ") or not.

Declaration
[BoolValidator]
public bool SgmlParserDecodeCharEntities { get; set; }
Property Value
Type Description
System.Boolean

StrictLanguageRouting

Defines if strict language determination should be used during routing.

Declaration
[BoolValidator]
public bool StrictLanguageRouting { get; set; }
Property Value
Type Description
System.Boolean

StringCompressionThreshold

Set to the number of characters when compression should be activated.

Declaration
public int StringCompressionThreshold { get; set; }
Property Value
Type Description
System.Int32

StringDelayedLoadThreshold

Set to the number of characters when delayed loading should be activated for large strings in properties deriving from Long String.

Declaration
public int StringDelayedLoadThreshold { get; set; }
Property Value
Type Description
System.Int32

SubscriptionHandler

Defines which class should handle mail

Declaration
public string SubscriptionHandler { get; set; }
Property Value
Type Description
System.String

UIDefaultValueForSetChangedOnPublish

Defines what the default state the "Update modified date" check box should be in when editing a page.

Declaration
[BoolValidator]
public bool UIDefaultValueForSetChangedOnPublish { get; set; }
Property Value
Type Description
System.Boolean

UIEditorCssPaths

Defines which css file to use when rendering the editor. Reg exp pattern for validation is "^/[\w/.-]{1,256}".

Declaration
[CustomRegexStringValidator("^[\\s]*$|^(?:(?:~/|/)(?:[a-zA-Z0-9\\-_\\.!\\~\\*'\\(\\):@&=\\+\\$,]+/)*\\w+[\\.\\-\\w]+\\w+[\\s]*,[\\s]*)*(?:(?:~/|/)(?:[a-zA-Z0-9\\-_\\.!\\~\\*'\\(\\):@&=\\+\\$,]+/)*\\w+[\\.\\-\\w]+\\w+){1}[\\s]*$", "The string must contain one or more comma-separated application- or host-relative virtual file paths, e.g. '~/folder/some.file, /another.file'.")]
public string UIEditorCssPaths { get; set; }
Property Value
Type Description
System.String

UIKeepUserLoggedOn

Sets if the current windows authenticated user must reauthenticate after session timeout.

Declaration
[BoolValidator]
public bool UIKeepUserLoggedOn { get; set; }
Property Value
Type Description
System.Boolean

UIMaxVersions

The maximum number of page versions that EPiServer will retain.

Declaration
public int UIMaxVersions { get; set; }
Property Value
Type Description
System.Int32

UIOptimizeTreeForSpeed

Sets if page tree controls should evaluate if tree nodes have children.

Declaration
[BoolValidator]
public bool UIOptimizeTreeForSpeed { get; set; }
Property Value
Type Description
System.Boolean

UISafeHtmlTags

Set which tags should not be encoded.

Declaration
public string UISafeHtmlTags { get; set; }
Property Value
Type Description
System.String

UIShowGlobalizationUserInterface

Defines if the globalization module should be used

Declaration
[BoolValidator]
public bool UIShowGlobalizationUserInterface { get; set; }
Property Value
Type Description
System.Boolean

UITheme

Setting for what graphical theme should be used.

Declaration
public string UITheme { get; set; }
Property Value
Type Description
System.String

UIUrl

Gets or sets the URL to the relocateable UI folder. It must be a Web URL, and may include scheme and port. It must be a Web URL, and include the path to the site root. It is only to be used to generate direct references to the site in external locations. For references from a page, use root-relative URLs and ResolveUrl etc as appropriate.

Declaration
[UrlValidator]
public Uri UIUrl { get; set; }
Property Value
Type Description
System.Uri

The "UI" URL. Guaranteed to end with a '/'.

UrlPreventRewriteAttrebute

For internal use, do not use. Defines the HTML attribute name that is used by the CMS 5 legacy editor when writing / parsing content

Declaration
public string UrlPreventRewriteAttrebute { get; set; }
Property Value
Type Description
System.String

UrlRebaseKind

Defines the type of rebasing to do for links when using Friendly URLs

Declaration
public string UrlRebaseKind { get; set; }
Property Value
Type Description
System.String

UrlRewriteExtension

Defines an extension that is mapped to ASP.NET for the URL

Declaration
public string UrlRewriteExtension { get; set; }
Property Value
Type Description
System.String

UseLegacyShortcutRouting

Gets or sets the useLegacyShortcutRouting that determines how request for pages with a shortcut should be handled. If value is true then the request will be redirected to the page it shorcuts to. If setting is false no redirection is done while data is fetched from shortcut page.

Declaration
public bool UseLegacyShortcutRouting { get; set; }
Property Value
Type Description
System.Boolean

UseStartPublishForDelayedPublishUntil

Set to false to disable the use of the start publish field to store the date the publishing of a content item should be delayed until.

Declaration
[BoolValidator]
public bool UseStartPublishForDelayedPublishUntil { get; set; }
Property Value
Type Description
System.Boolean
Remarks

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

UtilUrl

Gets or sets the URL to the relocateable Util folder. It must be a Web URL, and may include scheme and port. It must be a Web URL, and include the path to the site root. It is only to be used to generate direct references to the site in external locations. For references from a page, use root-relative URLs and ResolveUrl etc as appropriate.

Declaration
[UrlValidator]
public Uri UtilUrl { get; set; }
Property Value
Type Description
System.Uri

The "Util" URL. Guaranteed to end with a '/'.

Version

Gets the version of this configuration.

Declaration
public string Version { get; }
Property Value
Type Description
System.String

Methods

CopyValues(Settings, Settings)

Copies all values from one Settings instance to another instance.iisreset.

Declaration
public static void CopyValues(Settings source, Settings target)
Parameters
Type Name Description
Settings source
Settings target

InitializeAllSettings()

Sets up all static variables of the Settings class based on the web.config file in the applications root directory.

Declaration
[Obsolete("This method does nothing since configuration is always loaded when required")]
public static void InitializeAllSettings()

InitializeAllSettings(Configuration)

Sets up all static variables of the Settings class based on System.Configuration.Configuration object passed as a parameter.

Declaration
[Obsolete("Use ConfigurationSource.Instance = new FileConfigurationSource(value) to replace global configuration or use GlobalConfigurationManager to Load and Save configuration files")]
public static void InitializeAllSettings(Configuration config)
Parameters
Type Name Description
System.Configuration.Configuration config

The System.Configuration.Configuration object that contains the EPiServer settings.

Exceptions
Type Condition
System.Configuration.ConfigurationErrorsException

If there is an enterprise solution and the siteHosts section is missing with the value "*".

Save()

Save method for the web.config file.

Declaration
[Obsolete("Use GlobalConfigurationManager.Load and Save to make changes to the configuration file")]
public void Save()

Save(RestartMode)

Saves the configuration file.

Declaration
[Obsolete("Use GlobalConfigurationManager.Load and Save to make changes to the configuration file")]
public void Save(RestartMode mode)
Parameters
Type Name Description
RestartMode mode

ValidateRuntimeSettings()

Validates all settings consistency and with the runtime.

Declaration
public void ValidateRuntimeSettings()
Remarks

It's ok to call frequently. It will only validate when there's a valid HtppContext and a Control handling the request, and it will only validate once.

Extension Methods