title: How can I make my console application transfer files bigger than 4 MB using app.config
body: <p>I got the fortune to further develop an in-house console application written in C#. The purpuse of this application is to synchronize multiple files from one server to another, basically copy files from one to the other. The application works for files up to 4 MB and I can't find it anywhere in the application itself that limits the filesize to 4 MB other than for the log file.</p>
  
  <p>This console application is apart of a webapplication that stores forms that the users have created. I have managed to limit the webapplication to allow files no bigger than 100 MB in size and that works but the synchronization application won't transfer the bigger files from the depot to their respective places on the other server.</p>
  
  <p>Unfortunately I have no other log than the one that says the files (that aren't over 4 MB) where transfered OK. Debugging the application is a no go since it only runs on the server and I can't get it to work on my local machine.</p>
  
  <p>My question is thus, is there any posibility to set anything in the app.config file to allow the application to also synchronize files bigger than 4 MB?</p>
  
  <p>In the webapplication part of this big project I have used the following code:</p>
  
  <pre><code>&lt;system.web&gt;
      &lt;httpRuntime maxRequestLength="102400" executionTimeout="1200"/&gt;
  &lt;/system.web&gt;
  </code></pre>
  
  <p>But since this part isn't a webapplication it (appears) to not care about that line of configuration.</p>
  
  <p>This is the configuration file for the console synchronization application:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
      &lt;appSettings&gt;
          &lt;add key="SynchConfiguration" value="C:\Documents and Settings\My Documents\Visual Studio 2010\Projects\DepotSynch\Depot.Synch\DepotSynchConfiguration.xml"/&gt;
          &lt;add key="SynchLog"  value="C:\Documents and Settings\My Documents\Visual Studio 2010\Projects\DepotSynch\Depot.Synch\DepotSynchLOG.txt"/&gt;
          &lt;!-- Int Size in MB --&gt;
          &lt;add key="MaxLogFileSize" value="4"/&gt;
  
          &lt;!-- SHS Web Service API Configuration --&gt;
          &lt;add key="Status" value="test"/&gt;
          &lt;add key="From" value="1234567890"/&gt;
          &lt;!-- Identification Nummer --&gt;
          &lt;add key="To"  value="1234567890.web"/&gt;
          &lt;add key="CertLocation" value="certificate\test\test.p12"/&gt;
          &lt;!-- placeing of certet i filsystemet --&gt;
          &lt;add key="CertPwd" value="test234test"/&gt;
          &lt;!-- cert --&gt;
          &lt;!-- &lt;add key="ShsUrl" value="Is set ini DepotSynchConfiguration.xml for each environment"/&gt; --&gt;
          &lt;!-- URL to Shs Service --&gt;
          &lt;add key="ConnectByCertAndPwd" value="true"/&gt;
          &lt;!-- True/False - for certificate --&gt;
          &lt;add key="SendFileBySHS" value="false"/&gt;
          &lt;!-- For test. Won't send the file/s. --&gt;
      &lt;/appSettings&gt;
  
      &lt;system.serviceModel&gt;
          &lt;bindings&gt;
            &lt;wsHttpBinding&gt;
              &lt;binding name="MyWsHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"&gt;
                  &lt;readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
                  &lt;reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /&gt;
                  &lt;security mode="Message"&gt;
                      &lt;transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /&gt;
                      &lt;message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" /&gt;
                  &lt;/security&gt;
              &lt;/binding&gt;
              &lt;/wsHttpBinding&gt;
          &lt;/bindings&gt;
          &lt;client&gt;
              &lt;endpoint address="http://localhost:50232/Depot.svc"  binding="wsHttpBinding" bindingConfiguration="MyWsHttpBinding" contract="DepotReleaseServiceReference.IDepot" name="MyWsHttpBinding"&gt;
                  &lt;identity&gt;
                      &lt;servicePrincipalName value="&amp;#xD;&amp;#xA;          " /&gt;
                  &lt;/identity&gt;
              &lt;/endpoint&gt;
          &lt;/client&gt;
      &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Unfortunately I can't go and ask the original developer for help in this matter since he quit working here some 2 years ago.</p>