title: ConfigurationErrorException when debugging on Visual Studio 2010, .Net Framework 4, 32-bit
body: <p>I've run across an issue when debugging applications on VS 2010.</p>
  
  <p>This is a simple command-line app:</p>
  
  <pre><code>namespace HttpTest
  {
      class Program
      {
          public void testHTTP ()
          {
              Console.WriteLine("Creating HTTP request. Press a key to proceed.");
              Console.ReadKey();
              var request = (HttpWebRequest)HttpWebRequest.Create("http://stackoverflow.com");
              Console.WriteLine("Getting response...");
              var response = (HttpWebResponse)request.GetResponse();
              Console.WriteLine("Done");
              Console.ReadKey();
          }
  
          static void Main(string[] args)
          {
              Program app = new Program();
              app.testHTTP();
          }
     }
  }
  </code></pre>
  
  <p>If I launch/debug it from Visual Studio 2010, I get a <strong>ConfigurationErrorsException</strong> when creating the HttpWebRequest: </p>
  
  <blockquote>
    <p>Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.</p>
  </blockquote>
  
  <p>This is quite suprising, as my app.config has no entry in system.net/defaultProxy (and neither does my devenv.exe.config).</p>
  
  <p>By trying different settings, I found out that <em>the error only happens if I set the target framework to 4.0 and the target platform to x86 and try to debug within VS</em></p>
  
  <ul>
  <li>If I build it and run it from the command line (regardless of build settings), I have no issues.</li>
  <li>If I set the target Framework to 3.5, the error disappears and the app debugs normally.</li>
  <li>If I set the platform target to 'x64' or 'Any CPU', the app debugs normally.</li>
  <li>If I build on 4.0/x86, run from command line, attach the debugger while waiting for the first key press, then proceed, I get the error mentioned above.</li>
  <li>I have disabled the firewall on my machine</li>
  <li>Running VS as administrator makes no difference to the test.</li>
  <li>If I try this on a different machine, same hardware specs and OS, belonging to a colleague, I can debug it within VS2010.</li>
  </ul>
  
  <p>It obviously has something to do with the settings on my machine. However, I have been unable to isolate what the conditions are.</p>
  
  <p>Other users suggested moving the application to the C: drive. I don't think this applies to my case, as I can run int successfully from the D: drive. Issue happens only when debugging within VS.</p>