Note that there are some explanatory texts on larger screens.

plurals
  1. POError in client configuration file
    primarykey
    data
    text
    <p>I am trying to create an AppFabric cache client which is a console application. But receives the error <i>Error in client configuration file</i> while creating new instance of DataCacheFactory.<br/> Connection settings are provided in App.Config file as described in <a href="http://msdn.microsoft.com/en-us/library/hh334425%28v=azure.10%29.aspx" rel="nofollow">msdn</a>. <br/><b>Code</b></p> <pre><code>static void Main(string[] args) { try { DataCacheFactory dFact = new DataCacheFactory(); DataCache myCache = dFact.GetCache("default"); myCache.Remove("pValue"); myCache.Add("pValue", "Test Cache Value"); Console.WriteLine(string.Format("{0}", "Added to cache. Press any key to read....")); Console.ReadLine(); Console.WriteLine(string.Format("{0}", myCache.Get("pValue").ToString())); Console.ReadLine(); } catch (Exception Ex) { throw new System.Exception(Ex.ToString()); } } </code></pre> <p>} <br/><b>App.Config file</b></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;startup&gt; &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /&gt; &lt;/startup&gt; &lt;configSections&gt; &lt;section name="dataCacheClient" type="Microsoft.ApplicationServer.Caching.DataCacheClientSection, Microsoft.ApplicationServer.Caching.Core,Version=1.0.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35" allowLocation="true" allowDefinition="Everywhere" /&gt; &lt;/configSections&gt; &lt;dataCacheClient&gt; &lt;hosts&gt; &lt;host name="localhost" cachePort="22233"/&gt; &lt;/hosts&gt; &lt;/dataCacheClient&gt; &lt;/configuration&gt; </code></pre> <p><br/><b>Exception</b></p> <pre><code>Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode&lt;ERRCMC0003&gt;:SubStatus&lt;ES0001&gt;:Error in client configuration file. ---&gt; System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---&gt; System.Configuration.ConfigurationErrorsException: Only one &lt;configSections&gt; element allowed per config file and if present must be the first child of the root &lt;configuration&gt; element. (DistributedInMemory.vshost.exe.Config line 7) at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors() at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) --- End of inner exception stack trace --- at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName) at System.Configuration.ConfigurationManager.GetSection(String sectionName) at Microsoft.ApplicationServer.Caching.ClientConfigReader..ctor() at Microsoft.ApplicationServer.Caching.DataCacheFactoryConfiguration.Initialize(String path) --- End of inner exception stack trace --- at Microsoft.ApplicationServer.Caching.ConfigFile.ThrowException(Int32 errorCode, Exception e) at Microsoft.ApplicationServer.Caching.DataCacheFactoryConfiguration.Initialize(String path) at Microsoft.ApplicationServer.Caching.DataCacheFactory..ctor() at DistributedInMemory.Program.Main(String[] args) in DistributedInMemory\Program.cs:line 16 </code></pre> <p><br/> Any idea why this error happening....Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload