title: The type initializer for 'Homepage.Controllers.AppFlowMetadata' threw an exception
body: <p>This is weird.</p>
  
  <p>This is related to the article "Using OAuth 2.0 with Web applications (ASP.NET MVC)": <a href="https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#web-applications-aspnet-mvc" rel="nofollow">https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#web-applications-aspnet-mvc</a></p>
  
  <p>Disregard the entire code, no need, the question is this - there is a method:</p>
  
  <pre><code>    private static readonly IAuthorizationCodeFlow flow =
          new GoogleAuthorizationCodeFlow(new GoogleAuthorizationCodeFlow.Initializer
          {
              ClientSecrets = new ClientSecrets
              {
                  ClientId = WebConfigurationManager.AppSettings["ClientId"],
                  ClientSecret = WebConfigurationManager.AppSettings["ClientSecret"]
              },
              Scopes = new[] { CalendarService.Scope.Calendar, GmailService.Scope.GmailReadonly },
              DataStore = new FileDataStore(folder)
              //DataStore = new FileDataStore("Google.Auth.Store")
          });
  </code></pre>
  
  <p>If I use <strong>DataStore = new FileDataStore(folder)</strong> everything works, </p>
  
  <p>however, according to the documentation, I can just use </p>
  
  <p><strong>DataStore = new FileDataStore("Google.Auth.Store")</strong></p>
  
  <p>So, according to this article (<a href="http://www.daimto.com/google-net-filedatastore-demystified/" rel="nofollow">http://www.daimto.com/google-net-filedatastore-demystified/</a>) we should have a new folder called <strong>Google.Auth.Store</strong> created here with all the JSON token files in it:</p>
  
  <p><strong>%AppData%\Roaming\Google.Auth.Store\Google.Apis.Auth.OAuth2.Responses.TokenResponse-user</strong></p>
  
  <p><strong>Never happens!</strong></p>
  
  <p>Instead I get a blank page with a single error message:</p>
  
  <blockquote>
    <p>Index is not loading, try again later The type initializer for
    'Homepage.Controllers.AppFlowMetadata' threw an exception.</p>
  </blockquote>
  
  <p>Why is this happening? according to the documentation this is exactly how it should be.</p>