<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="cacheManager" type="CacheManager.Core.Configuration.CacheManagerSection, CacheManager.Core" />
        <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
    </configSections>

    <connectionStrings>
        <add name="VirtoCommerceBaseUrl" connectionString="http://localhost/admin" />
    </connectionStrings>

    <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" throwExceptions="true" autoReload="true">
        <targets>
            <target name="debugger" xsi:type="Debugger" layout="${logger}::${message}" />
        </targets>
        <rules>
            <logger name="*" writeTo="debugger" />
        </rules>
    </nlog>

    <cacheManager xmlns="http://tempuri.org/CacheManagerCfg.xsd">
        <managers>
            <cache name="storefrontCache" updateMode="Up" enableStatistics="false" enablePerformanceCounters="false">
                <handle ref="runtimeMemory" name="inMemoryCacheHandle" expirationMode="Absolute" timeout="10m" />
            </cache>
        </managers>
        <cacheHandles>
            <handleDef id="runtimeMemory" type="CacheManager.SystemRuntimeCaching.MemoryCacheHandle`1, CacheManager.SystemRuntimeCaching" />
        </cacheHandles>
    </cacheManager>

    <system.runtime.caching>
        <memoryCache>
            <namedCaches>
                <add name="default" cacheMemoryLimitMegabytes="0" pollingInterval="00:02:00" />
            </namedCaches>
        </memoryCache>
    </system.runtime.caching>

    <system.net>
        <connectionManagement>
            <add address="*" maxconnection="96" />
        </connectionManagement>
    </system.net>

    <appSettings>
        <add key="DefaultStore" value="Electronics" />
        <add key="vs:EnableBrowserLink" value="false" />
        <add key="webpages:Version" value="3.0.0.0" />
        <add key="webpages:Enabled" value="false" />
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />

        <add key="vc-public-ApiAppId" value="27e0d789f12641049bd0e939185b4fd2" />
        <add key="vc-public-ApiSecretKey" value="34f0a3c12c9dbb59b63b5fece955b7b2b9a3b20f84370cba1524dd5c53503a2e2cb733536ecf7ea1e77319a47084a3a2c9d94d36069a432ecc73b72aeba6ea78" />

		<!-- OAuth2 settings -->
		<add key="OAuth2.Google.ClientId" value="SECRET" />
		<add key="OAuth2.Google.Secret" value="SECRET" />
		<add key="OAuth2.Facebook.AppId" value="SECRET" />
		<add key="OAuth2.Facebook.Secret" value="SECRET" />

		<!-- Content settings -->
		<add key="vc-public-pages" value="~/App_data/Pages" />
		<add key="vc-public-themes" value="~/App_data/Themes" />
    </appSettings>
    <system.web>
        <customErrors mode="Off" />
        <compilation targetFramework="4.5.1" debug="true" />
        <httpRuntime targetFramework="4.5.1" />
        <caching>
            <outputCache defaultProvider="CacheManagerOutputCacheProvider" enableOutputCache="true">
                <providers>
                    <add name="CacheManagerOutputCacheProvider" type="CacheManager.Web.CacheManagerOutputCacheProvider, CacheManager.Web" cacheName="storefrontCache" />
                </providers>
            </outputCache>
            <outputCacheSettings>
                <outputCacheProfiles>
                    <add name="AssetsCachingProfile" enabled="true" location="ServerAndClient" duration="216000" varyByParam="*" />
                    <add name="ProductCachingProfile" enabled="true" location="Server" duration="216000" varyByParam="*" varyByCustom="Currency" />
                    <add name="CatalogSearchCachingProfile" enabled="true" location="Server" duration="216000" varyByParam="*" varyByCustom="Currency"/>
                    <add name="HomeCachingProfile" enabled="true" location="Server" duration="216000" varyByParam="*" varyByCustom="Currency"/>
                    <add name="CommonCachingProfile" enabled="true" location="ServerAndClient" duration="9916000" varyByParam="*" />
                    <add name="StaticContentCachingProfile" enabled="true" location="ServerAndClient" duration="9916000" varyByParam="*" />
                </outputCacheProfiles>
            </outputCacheSettings>
        </caching>
    </system.web>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true">
            <!--  Web API Put Request generates an Http 405 Method Not Allowed error -->
            <remove name="WebDAVModule" />
            <remove name="FormsAuthentication" />
            <remove name="UrlRoutingModule-4.0" />
            <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" />
        </modules>

        <security>
            <requestFiltering allowDoubleEscaping="true">
            </requestFiltering>
        </security>
    </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>
