Windows Server AppFabric 1.1 Caching client exception when project is compiled for .Net Framework 4.0 or higher
-
Thursday, February 02, 2012 10:21 PM
Recently I decided to upgrade the dev appfabric caching cluster server and my local client to v 1.1. Reinstalled server on 2 fresh new VMs, opened all ports, set up security, figured out that an additional port on both servers needs to be opened (ICMPv4 8 - 0) to have cluster hosts communicate with each other.
When I removed the v 1.0 client and installed v 1.1 client on my workstation, I've started getting the following errors during the execution of this line:
cacheFactory.GetCache("default");
Type 'Microsoft.ApplicationServer.Caching.HostNodeDomainConfigurationElementCollection' is an invalid collection type since it does not have a valid Add method with parameter of type 'System.Object'
It turned out that if I set the target Framework to be 3.5 then all works fine, when 4.0 or above (I do run VS11 side by side on this workstation), it breaks.
List<DataCacheServerEndpoint> servers = new List<DataCacheServerEndpoint>(1);
servers.Add(new DataCacheServerEndpoint("dev-app-01", 22233));
servers.Add(new DataCacheServerEndpoint("dev-app-02", 22233));
DataCacheFactoryConfiguration configuration = new DataCacheFactoryConfiguration();
configuration.Servers = servers;
configuration.LocalCacheProperties = new DataCacheLocalCacheProperties();
configuration.SecurityProperties = new DataCacheSecurity(DataCacheSecurityMode.None, DataCacheProtectionLevel.None);
DataCacheClientLogManager.ChangeLogLevel(System.Diagnostics.TraceLevel.Off);
DataCacheFactory _factory = new DataCacheFactory(configuration);
DataCache _cache = _factory.GetCache("default");Removed 1.1 client and installed 1.0 client and it started working again.
Seeking for advise ! :)
Thank you
Roman Tumaykin
Roman
All Replies
-
Friday, February 03, 2012 9:29 AM
Which version of .NET is installed on the box ? Is it .NET 4.5 Dev. Preview ?
arunks- Proposed As Answer by Ankit Sud [MSFT]Microsoft Employee Monday, February 06, 2012 4:32 AM
-
Friday, February 03, 2012 10:48 PMWow. Thanks for pointing me to the right direction. This is simply amazing. When I tried the same code on a fresh VM without .Net 4.5 installed on it - everything worked with. So as I understand - an installation of .Net 4.5 dev preview overwrites the existing 4.0 .Net framework. Scary.
Roman

