title: Value cannot be null. Parameter name: username. Starting .net application
body: <p>When I start the application from Visual Studio 2010  the following error shows up:</p>
  
  <blockquote>
    <p><em>Value cannot be null.\r\nParameter name: username</em></p>
  </blockquote>
  
  <p>I can see this error in <code>Global.asax.cs</code> in the parameter sender of this method:</p>
  
  <pre><code>    void Application_Error(object sender, EventArgs e)
      {
      }
  </code></pre>
  
  <p>The problem is that I'm not using username anywhere and my web.config</p>
  
  <pre><code>    &lt;configuration&gt;
        &lt;connectionStrings&gt;
          &lt;add name="MYSQL"
               connectionString="Driver={MySQL ODBC 5.2w Driver};Server=server_name;Database=database_name;uid=my_user_id;pwd=my_pwd"
               providerName="System.Data.Odbc"/&gt;
        &lt;/connectionStrings&gt;
        &lt;system.web&gt;
           &lt;compilation debug="true" targetFramework="4.0" /&gt;
        &lt;/system.web&gt;
    &lt;/configuration&gt;
  </code></pre>
  
  <p>Any help will be welcome.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>More information:</p>
  
  <p>What I can see is: </p>
  
  <pre><code>sender.base.Profile.base.base.Session = '((System.Web.HttpApplication)(sender)).Session' threw an exception of type 'System.Web.HttpException' 
  </code></pre>
  
  <p>and </p>
  
  <pre><code>sender.Profile.base.LastActivityDate = '((System.Web.Profile.ProfileBase)(((ASP.global_asax)(sender)).Profile)).LastAct‌​ivityDate' threw an exception of type 'System.ArgumentNullException' 
  </code></pre>
  
  <p>and </p>
  
  <pre><code>sender.Profile.base.LastActivityDate.base = {"Value cannot be null.\r\nParameter name: username"}
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>This code works without any problem, and also I can execute queries.</p>
  
  <pre><code>    void Application_Start(object sender, EventArgs e)
      {
          string ConnStr = System.Configuration.ConfigurationManager.ConnectionStrings["MYSQL"].ConnectionString;
          OdbcConnection con = new OdbcConnection(ConnStr);
          con.Open();
          con.Close();
       }
  </code></pre>