title: ConfigurationManager in System.Configuration.dll make exception
body: <p>I am writing WCF service for silverlight application. In MainService I want to read information from config file. So I want to use ConfigurationManager. I added System.Configuration.dll to project compile and published. Then after call WCF service gets an error, see bellow.
  If I dont use the ConfigurationManager (no referencing DLL) it is working.
  Here is part of code to call settings and stored settings in config.</p>
  
  <pre><code>var connectionManagerDatabaseServers = ConfigurationManager.GetSection("ConnectionManagerDatabaseServers") as NameValueCollection;
  string config = connectionManagerDatabaseServers["ConnectionString"];
  
  &lt;configSections&gt;
      &lt;section name="ConnectionManagerDatabaseServers" type="System.Configuration.NameValueSectionHandler" /&gt;
  &lt;/configSections&gt;
  
  &lt;ConnectionManagerDatabaseServers&gt;
      &lt;add key="DatabaseType" value="1" /&gt;
      &lt;add key="ConnectionString" value="VALUE" /&gt;
  &lt;/ConnectionManagerDatabaseServers&gt;
  </code></pre>
  
  <blockquote>
    <p>The server encountered an error processing the request. The exception message is 'Padding is invalid and cannot be removed.'. See server logs for more details. The exception stack trace is: </p>
    
    <p>at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]&amp; outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at System.Security.Cryptography.CryptoStream.FlushFinalBlock() at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.IO.Stream.Dispose() at GX.Framework.Utils.Encryption.Decrypt(String encryptedText) at ServiceWCF.MainService..ctor() at CreateServiceWCF.MainService() at System.ServiceModel.Dispatcher.InstanceProvider.GetInstance(InstanceContext instanceContext, Message message) at System.ServiceModel.Dispatcher.InstanceBehavior.GetInstance(InstanceContext instanceContext, Message request) at System.ServiceModel.InstanceContext.GetServiceInstance(Message message) at System.ServiceModel.Dispatcher.InstanceBehavior.EnsureServiceInstance(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</p>
  </blockquote>