Removed support for Shared Cache from Azure caching providers.

Fixed bug in Azure output cache provider with tenant names containing non-alphanumeric characters.
Removed all Azure-related assembly references from Orchard.Web.csproj.
This commit is contained in:
Daniel Stolt
2013-09-04 21:57:48 +02:00
parent 690e7f60e1
commit c8e277ba11
10 changed files with 164 additions and 263 deletions

View File

@@ -7,16 +7,10 @@
<Setting name="Orchard.Azure.Settings.StorageConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="Orchard.Azure.OutputCache.HostIdentifier" value="Orchard.Azure.Web" />
<Setting name="Orchard.Azure.OutputCache.CacheName" value="OutputCache" />
<Setting name="Orchard.Azure.OutputCache.Hostname" value="" />
<Setting name="Orchard.Azure.OutputCache.Port" value="" />
<Setting name="Orchard.Azure.OutputCache.AuthorizationToken" value="" />
<Setting name="Orchard.Azure.OutputCache.IsSharedCaching" value="false" />
<Setting name="Orchard.Azure.DatabaseCache.HostIdentifier" value="Orchard.Azure.Web" />
<Setting name="Orchard.Azure.DatabaseCache.CacheName" value="DatabaseCache" />
<Setting name="Orchard.Azure.DatabaseCache.Hostname" value="" />
<Setting name="Orchard.Azure.DatabaseCache.Port" value="" />
<Setting name="Orchard.Azure.DatabaseCache.AuthorizationToken" value="" />
<Setting name="Orchard.Azure.DatabaseCache.IsSharedCaching" value="false" />
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.NamedCaches" value="{&quot;caches&quot;:[{&quot;name&quot;:&quot;default&quot;,&quot;policy&quot;:{&quot;eviction&quot;:{&quot;type&quot;:0},&quot;expiration&quot;:{&quot;defaultTTL&quot;:10,&quot;isExpirable&quot;:true,&quot;type&quot;:1},&quot;serverNotification&quot;:{&quot;isEnabled&quot;:false}},&quot;secondaries&quot;:0},{&quot;name&quot;:&quot;SessionStateCache&quot;,&quot;policy&quot;:{&quot;eviction&quot;:{&quot;type&quot;:0},&quot;expiration&quot;:{&quot;defaultTTL&quot;:60,&quot;isExpirable&quot;:true,&quot;type&quot;:2},&quot;serverNotification&quot;:{&quot;isEnabled&quot;:false}},&quot;secondaries&quot;:0},{&quot;name&quot;:&quot;OutputCache&quot;,&quot;policy&quot;:{&quot;eviction&quot;:{&quot;type&quot;:0},&quot;expiration&quot;:{&quot;defaultTTL&quot;:5,&quot;isExpirable&quot;:true,&quot;type&quot;:1},&quot;serverNotification&quot;:{&quot;isEnabled&quot;:false}},&quot;secondaries&quot;:0},{&quot;name&quot;:&quot;DatabaseCache&quot;,&quot;policy&quot;:{&quot;eviction&quot;:{&quot;type&quot;:0},&quot;expiration&quot;:{&quot;defaultTTL&quot;:5,&quot;isExpirable&quot;:true,&quot;type&quot;:1},&quot;serverNotification&quot;:{&quot;isEnabled&quot;:false}},&quot;secondaries&quot;:0}]}" />
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel" value="1" />

View File

@@ -17,16 +17,10 @@
<Setting name="Orchard.Azure.Media.StorageConnectionString" />
<Setting name="Orchard.Azure.OutputCache.HostIdentifier" />
<Setting name="Orchard.Azure.OutputCache.CacheName" />
<Setting name="Orchard.Azure.OutputCache.Hostname" />
<Setting name="Orchard.Azure.OutputCache.Port" />
<Setting name="Orchard.Azure.OutputCache.AuthorizationToken" />
<Setting name="Orchard.Azure.OutputCache.IsSharedCaching" />
<Setting name="Orchard.Azure.DatabaseCache.HostIdentifier" />
<Setting name="Orchard.Azure.DatabaseCache.CacheName" />
<Setting name="Orchard.Azure.DatabaseCache.Hostname" />
<Setting name="Orchard.Azure.DatabaseCache.Port" />
<Setting name="Orchard.Azure.DatabaseCache.AuthorizationToken" />
<Setting name="Orchard.Azure.DatabaseCache.IsSharedCaching" />
</ConfigurationSettings>
<Endpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80" />

View File

@@ -16,9 +16,6 @@
public const string CacheHostIdentifierSettingName = "HostIdentifier";
public const string CacheCacheNameSettingName = "CacheName";
public const string CacheHostnameSettingName = "Hostname";
public const string CachePortSettingName = "Port";
public const string CacheAuthorizationTokenSettingName = "AuthorizationToken";
public const string CacheIsSharedCachingSettingName = "IsSharedCaching";
}
}

View File

@@ -49,6 +49,14 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\log4net\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ApplicationServer.Caching.AzureClientHelper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.AzureClientHelper.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ApplicationServer.Caching.AzureCommon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.AzureCommon.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ApplicationServer.Caching.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.Client.dll</HintPath>
@@ -57,14 +65,46 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.DistributedCache, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.Web.DistributedCache.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Diagnostics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Diagnostics.StorageUtility, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Diagnostics.StorageUtility.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsAzure.ServiceRuntime.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsFabric.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsFabric.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsFabric.Data.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsFabric.Data.Common.dll</HintPath>
</Reference>
<Reference Include="NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\nhibernate\NHibernate.dll</HintPath>

View File

@@ -7,15 +7,10 @@ namespace Orchard.Azure.Services.Caching {
public class CacheClientConfiguration {
public static CacheClientConfiguration FromPlatformConfiguration(string tenant, string settingNamePrefix) {
var portString = PlatformConfiguration.GetSetting(Constants.CachePortSettingName, tenant, settingNamePrefix);
var isSharedCachingString = PlatformConfiguration.GetSetting(Constants.CacheIsSharedCachingSettingName, tenant, settingNamePrefix);
return new CacheClientConfiguration {
HostIdentifier = PlatformConfiguration.GetSetting(Constants.CacheHostIdentifierSettingName, tenant, settingNamePrefix),
CacheName = PlatformConfiguration.GetSetting(Constants.CacheCacheNameSettingName, tenant, settingNamePrefix),
Hostname = PlatformConfiguration.GetSetting(Constants.CacheHostnameSettingName, tenant, settingNamePrefix),
Port = String.IsNullOrWhiteSpace(portString) ? 0 : Int32.Parse(portString),
AuthorizationToken = PlatformConfiguration.GetSetting(Constants.CacheAuthorizationTokenSettingName, tenant, settingNamePrefix),
IsSharedCaching = !String.IsNullOrWhiteSpace(isSharedCachingString) && Boolean.Parse(isSharedCachingString)
};
}
@@ -29,40 +24,19 @@ namespace Orchard.Azure.Services.Caching {
protected set;
}
public string Hostname {
get;
protected set;
}
public int Port {
get;
protected set;
}
public string AuthorizationToken {
get;
protected set;
}
public bool IsSharedCaching {
get;
protected set;
}
public bool CompressionIsEnabled {
get;
set;
}
public bool AutodiscoverIsEnabled {
get {
return String.IsNullOrWhiteSpace(Hostname) || Port == 0 || String.IsNullOrWhiteSpace(AuthorizationToken);
}
}
public void Validate() {
if (AutodiscoverIsEnabled && String.IsNullOrWhiteSpace(HostIdentifier)) {
throw new Exception("AutoDiscover mode is detected but HostIdentifier is missing or empty.");
if (String.IsNullOrWhiteSpace(HostIdentifier)) {
throw new Exception("The HostIdentifier value is missing or empty.");
}
}
@@ -73,27 +47,22 @@ namespace Orchard.Azure.Services.Caching {
IsCompressionEnabled = CompressionIsEnabled
};
if (AutodiscoverIsEnabled) {
dataCacheFactoryConfiguration.AutoDiscoverProperty = new DataCacheAutoDiscoverProperty(true, HostIdentifier);
}
else {
dataCacheFactoryConfiguration.AutoDiscoverProperty = new DataCacheAutoDiscoverProperty(false);
dataCacheFactoryConfiguration.Servers = new[] { new DataCacheServerEndpoint(Hostname, Port) };
dataCacheFactoryConfiguration.SecurityProperties = new DataCacheSecurity(AuthorizationToken);
}
if (!String.IsNullOrEmpty(AuthorizationToken))
dataCacheFactoryConfiguration.SecurityProperties = new DataCacheSecurity(AuthorizationToken, sslEnabled: false);
var dataCacheFactory = new DataCacheFactory(dataCacheFactoryConfiguration);
if (IsSharedCaching || String.IsNullOrEmpty(CacheName)) {
return dataCacheFactory.GetDefaultCache();
}
if (!String.IsNullOrEmpty(CacheName)) {
return dataCacheFactory.GetCache(CacheName);
}
public override string ToString() {
var key = HostIdentifier + "_" + CacheName + "_" + Hostname + "_" + Port + "_" + AuthorizationToken + "_" + IsSharedCaching + "_" + CompressionIsEnabled;
return key;
return dataCacheFactory.GetDefaultCache();
}
//public override string ToString() {
// var key = HostIdentifier + "_" + CacheName + "_" + Hostname + "_" + Port + "_" + AuthorizationToken + "_" + IsSharedCaching + "_" + CompressionIsEnabled;
// return key;
//}
}
}

View File

@@ -8,22 +8,19 @@ namespace Orchard.Azure.Services.Caching.Database {
public class AzureCacheClient : ICache {
public AzureCacheClient(DataCache cache, bool isSharedCaching, string region, TimeSpan? expirationTime) {
public AzureCacheClient(DataCache cache, string region, TimeSpan? expirationTime) {
_logger = LoggerProvider.LoggerFor(typeof(AzureCacheClient));
_cache = cache;
_isSharedCaching = isSharedCaching;
_region = region ?? DefaultRegion;
// Azure Cache supports only alphanumeric strings for regions and
// Orchard can get a lot more creative than that. Remove all non
// Azure Cache supports only alphanumeric strings for regions, but
// NHibernate can get a lot more creative than that. Remove all non
// alphanumering characters from the region, and append the hash code
// of the original string to mitigate the risk of two distinct original
// region strings yielding the same transformed region string.
_regionAlphaNumeric = new String(Array.FindAll(_region.ToCharArray(), Char.IsLetterOrDigit)) + _region.GetHashCode().ToString(CultureInfo.InvariantCulture);
_expirationTime = expirationTime;
if (!isSharedCaching) {
_cache.CreateRegion(_regionAlphaNumeric);
}
//_lockHandleDictionary = new ConcurrentDictionary<object, DataCacheLockHandle>();
//_lockTimeout = TimeSpan.FromSeconds(30);
@@ -36,22 +33,17 @@ namespace Orchard.Azure.Services.Caching.Database {
private const string DefaultRegion = "NHibernate";
private readonly IInternalLogger _logger;
private readonly DataCache _cache;
private readonly bool _isSharedCaching;
private readonly string _region;
private readonly string _regionAlphaNumeric;
private readonly TimeSpan? _expirationTime;
public object Get(object key) {
if (key == null)
if (key == null) {
throw new ArgumentNullException("key", "The parameter 'key' must not be null.");
}
if (_logger.IsDebugEnabled) {
if (_logger.IsDebugEnabled)
_logger.DebugFormat("Get() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
}
if (_isSharedCaching) {
return _cache.Get(GetSharedCachingKey(key));
}
return _cache.Get(key.ToString(), _regionAlphaNumeric);
}
@@ -60,7 +52,6 @@ namespace Orchard.Azure.Services.Caching.Database {
if (key == null) {
throw new ArgumentNullException("key", "The parameter 'key' must not be null.");
}
if (value == null) {
throw new ArgumentNullException("value", "The parameter 'value' must not be null.");
}
@@ -69,10 +60,7 @@ namespace Orchard.Azure.Services.Caching.Database {
_logger.DebugFormat("Put() invoked with key='{0}' and value='{1}' in region '{2}'.", key, value, _regionAlphaNumeric);
}
if (_isSharedCaching) {
_cache.Put(GetSharedCachingKey(key), value);
}
else if (_expirationTime.HasValue) {
if (_expirationTime.HasValue) {
_cache.Put(key.ToString(), value, _expirationTime.Value, _regionAlphaNumeric);
}
else {
@@ -89,10 +77,6 @@ namespace Orchard.Azure.Services.Caching.Database {
_logger.DebugFormat("Remove() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
}
if (_isSharedCaching) {
_cache.Remove(key.ToString());
}
_cache.Remove(key.ToString(), _regionAlphaNumeric);
}
@@ -101,10 +85,6 @@ namespace Orchard.Azure.Services.Caching.Database {
_logger.DebugFormat("Clear() invoked in region '{0}'.", _regionAlphaNumeric);
}
if (_isSharedCaching) {
return; // Can't remove an individual region with Shared Caching.
}
_cache.ClearRegion(_regionAlphaNumeric);
}
@@ -193,9 +173,5 @@ namespace Orchard.Azure.Services.Caching.Database {
return _region;
}
}
private string GetSharedCachingKey(object key) {
return String.Format("{0}_{1}", _region, key);
}
}
}

View File

@@ -8,7 +8,6 @@ namespace Orchard.Azure.Services.Caching.Database {
public class AzureCacheProvider : ICacheProvider {
private DataCache _dataCache;
private bool _isSharedCaching;
public ICache BuildCache(string regionName, IDictionary<string, string> properties) {
@@ -22,7 +21,7 @@ namespace Orchard.Azure.Services.Caching.Database {
expiration = TimeSpan.FromSeconds(Int32.Parse(expirationString));
}
return new AzureCacheClient(_dataCache, _isSharedCaching, regionName, expiration);
return new AzureCacheClient(_dataCache, regionName, expiration);
}
public long NextTimestamp() {
@@ -49,7 +48,6 @@ namespace Orchard.Azure.Services.Caching.Database {
}
_dataCache = configuration.CreateCache();
_isSharedCaching = configuration.IsSharedCaching;
}
public void Stop() {

View File

@@ -7,6 +7,7 @@ using Orchard.Environment.Extensions;
using Orchard.Logging;
using Orchard.OutputCache.Models;
using Orchard.OutputCache.Services;
using System.Globalization;
namespace Orchard.Azure.Services.Caching.Output {
@@ -25,68 +26,44 @@ namespace Orchard.Azure.Services.Caching.Output {
}
_cache = _cacheConfig.CreateCache();
if (!_cacheConfig.IsSharedCaching) {
// If not using Windows Azure Shared Caching we can enable additional features by
// storing all cache items in a region. This enables enumerating and counting all
// items currently in the cache.
_region = shellSettings.Name;
_cache.CreateRegion(_region);
}
// Azure Cache supports only alphanumeric strings for regions, but Orchard supports some
// non-alphanumeric characters in tenant names. Remove all non-alphanumering characters
// from the region, and append the hash code of the original string to mitigate the risk
// of two distinct original region strings yielding the same transformed region string.
_regionAlphaNumeric = new String(Array.FindAll(_region.ToCharArray(), Char.IsLetterOrDigit)) + _region.GetHashCode().ToString(CultureInfo.InvariantCulture);
_cache.CreateRegion(_regionAlphaNumeric);
}
private readonly CacheClientConfiguration _cacheConfig;
private readonly DataCache _cache;
private readonly string _region;
private readonly string _regionAlphaNumeric;
public void Set(string key, CacheItem cacheItem) {
Logger.Debug("Set() invoked with key='{0}' in region '{1}'.", key, _region);
if (_cacheConfig.IsSharedCaching) {
_cache.Put(key, cacheItem);
}
else {
_cache.Put(key, cacheItem, TimeSpan.FromSeconds(cacheItem.ValidFor), _region);
}
Logger.Debug("Set() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
_cache.Put(key, cacheItem, TimeSpan.FromSeconds(cacheItem.ValidFor), _regionAlphaNumeric);
}
public void Remove(string key) {
Logger.Debug("Remove() invoked with key='{0}' in region '{1}'.", key, _region);
if (_cacheConfig.IsSharedCaching) {
_cache.Remove(key);
}
else {
_cache.Remove(key, _region);
}
Logger.Debug("Remove() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
_cache.Remove(key, _regionAlphaNumeric);
}
public void RemoveAll() {
Logger.Debug("RemoveAll() invoked in region '{0}'.", _region);
if (_cacheConfig.IsSharedCaching) {
_cache.Clear();
}
else {
_cache.ClearRegion(_region);
}
Logger.Debug("RemoveAll() invoked in region '{0}'.", _regionAlphaNumeric);
_cache.ClearRegion(_regionAlphaNumeric);
}
public CacheItem GetCacheItem(string key) {
Logger.Debug("GetCacheItem() invoked with key='{0}' in region '{1}'.", key, _region);
if (_cacheConfig.IsSharedCaching) {
return _cache.Get(key) as CacheItem;
}
else {
return _cache.Get(key, _region) as CacheItem;
}
Logger.Debug("GetCacheItem() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
return _cache.Get(key, _regionAlphaNumeric) as CacheItem;
}
public IEnumerable<CacheItem> GetCacheItems(int skip, int count) {
Logger.Debug("GetCacheItems() invoked in region '{0}'.", _region);
if (_cacheConfig.IsSharedCaching) {
Logger.Debug("Enumeration not supported with Shared Caching; returning empty enumerable.");
return Enumerable.Empty<CacheItem>(); // Enumeration not supported with Shared Caching.
}
return _cache.GetObjectsInRegion(_region).AsParallel()
Logger.Debug("GetCacheItems() invoked in region '{0}'.", _regionAlphaNumeric);
return _cache.GetObjectsInRegion(_regionAlphaNumeric).AsParallel()
.Select(x => x.Value)
.OfType<CacheItem>()
.Skip(skip)
@@ -95,13 +72,8 @@ namespace Orchard.Azure.Services.Caching.Output {
}
public int GetCacheItemsCount() {
Logger.Debug("GetCacheItemsCount() invoked in region '{0}'.", _region);
if (_cacheConfig.IsSharedCaching) {
Logger.Debug("Enumeration not supported with Shared Caching; returning zero.");
return 0; // Enumeration not supported with Shared Caching.
}
return _cache.GetObjectsInRegion(_region).AsParallel()
Logger.Debug("GetCacheItemsCount() invoked in region '{0}'.", _regionAlphaNumeric);
return _cache.GetObjectsInRegion(_regionAlphaNumeric).AsParallel()
.Select(x => x.Value)
.OfType<CacheItem>()
.Count();

View File

@@ -49,62 +49,10 @@
<HintPath>..\..\lib\autofac\Autofac.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ApplicationServer.Caching.AzureClientHelper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.AzureClientHelper.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ApplicationServer.Caching.AzureCommon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.AzureCommon.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ApplicationServer.Caching.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.DistributedCache, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.Web.DistributedCache.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\lib\aspnetmvc\Microsoft.Web.Infrastructure.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.WindowsAzure.Diagnostics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.WindowsAzure.ServiceRuntime.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsFabric.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.WindowsFabric.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsFabric.Data.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\windowsazure\Microsoft.WindowsFabric.Data.Common.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\lib\newtonsoft.json\Newtonsoft.Json.dll</HintPath>
</Reference>

View File

@@ -8,7 +8,11 @@
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/>
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/>
</sectionGroup>
<section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />
<!--
Uncomment below to store session state in Windows Azure Cache Service.
NOTE: You must add assembly references to all assemblies in lib/windowsazure before enabling.
-->
<!--<section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />-->
</configSections>
<appSettings>
@@ -34,11 +38,16 @@
<!--
Uncomment below to store session state in Windows Azure Cache Service.
Set {CacheHostIdentifier} to be the endpoint of the cache cluster.
Set the autoDiscover/@identifier attribute to be the endpoint of the cache cluster.
Set the messageSecurity/@authorizationInfo to be either the primary or secondary key of your cache cluster.
NOTE: You must add assembly references to all assemblies in lib/windowsazure before enabling.
-->
<!--<dataCacheClients>
<dataCacheClient name="DefaultCacheClient" useLegacyProtocol="false" connectionPool="true" maxConnectionsToServer="20">
<autoDiscover isEnabled="true" identifier="{CacheHostIdentifier}" />
<autoDiscover isEnabled="true" identifier="[clustername].cache.windows.net" />
<securityProperties mode="Message" sslEnabled="false">
<messageSecurity authorizationInfo="[key]"/>
</securityProperties>
</dataCacheClient>
</dataCacheClients>-->
@@ -91,10 +100,14 @@
<forms loginUrl="~/Users/Account/AccessDenied" timeout="2880"/>
</authentication>
<!-- Uncomment below to store session state in Windows Azure Cache (replace {CacheName} with name of your configured cache). -->
<!--
Uncomment below to store session state in Windows Azure Cache Service.
Set the add/@cacheName attribute to be the name of a configured named cache, or leave it blank to use the default cache.
NOTE: You must add assembly references to all assemblies in lib/windowsazure before enabling.
-->
<!--<sessionState mode="Custom" timeout="60" customProvider="CacheSessionStateProvider">
<providers>
<add name="CacheSessionStateProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="{CacheName}" dataCacheClientName="DefaultCacheClient" applicationName="Orchard" />
<add name="CacheSessionStateProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="[cacheName]" dataCacheClientName="DefaultCacheClient" applicationName="Orchard" />
</providers>
</sessionState>-->