Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.

问题 connect to AppFabric error

  • 2012年4月10日 20:58
     
     

    Hi , on connect to AppFabric i receive this error :

    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'.

    This is my code :

      List<DataCacheServerEndpoint> servers = new List<DataCacheServerEndpoint>(1);

                    string server = "192.168.1.87";
                    servers.Add(new DataCacheServerEndpoint(server, 22233));

                   
                    DataCacheFactoryConfiguration configuration = new DataCacheFactoryConfiguration();
                    configuration.ChannelOpenTimeout = System.TimeSpan.FromSeconds(20);
                    configuration.TransportProperties.ReceiveTimeout = System.TimeSpan.FromSeconds(20);
                    configuration.TransportProperties.ChannelInitializationTimeout = System.TimeSpan.FromSeconds(20);
                    configuration.SecurityProperties = new DataCacheSecurity(DataCacheSecurityMode.None, DataCacheProtectionLevel.None);


                    configuration.Servers = servers;
                    configuration.NotificationProperties = new DataCacheNotificationProperties(200, new TimeSpan(0, 0, 0, 5));


                    configuration.LocalCacheProperties = new DataCacheLocalCacheProperties();

                    DataCacheClientLogManager.ChangeLogLevel(System.Diagnostics.TraceLevel.Off);

                    DataCacheFactory CacheFactory = null;

                    CacheFactory = new DataCacheFactory(configuration);

                   
                    myDefaultCache = CacheFactory.GetCache("Rates");

                    DataCacheOperations allCacheOperations = DataCacheOperations.AddItem |
                                                                      DataCacheOperations.ReplaceItem |
                                                                      DataCacheOperations.RemoveItem;
                    myDefaultCache.AddItemLevelCallback("Rates", allCacheOperations, myCacheLvlDelegate);

    I don't understand what a problem in my code ? 

    Regards

    Alex



    • 已编辑 alexkg1 2012年4月10日 21:00
    •  

全部回复

  • 2012年4月17日 12:14
     
     

    Hi,

    Which version of .NET you have on the box ? With 4.0 are you getting this exception ?

    Thanks

    Arun


    arunks