title: C#: Google.Apis.Auth.OAuth2.Responses.TokenResponseException: Error:"invalid_client", Description:"The OAuth client was not found.", Uri:""
body: <p>I am trying to integrate Google calendar in my web application. I have successfully integrate Google calendar and able to read events from my Visual Studio IIS Express server. But when I publish and upload my application on web server I have start receiving error</p>
  
  <blockquote>
    <p>Google.Apis.Auth.OAuth2.Responses.TokenResponseException: Error:"invalid_client", Description:"The OAuth client was not found.", Uri:""</p>
  </blockquote>
  
  <p><strong>My Code</strong></p>
  
  <pre><code>var certificate = new X509Certificate2(System.Web.HttpContext.Current.Server.MapPath("~/App_Data/key.p12"), "notasecret", X509KeyStorageFlags.Exportable);
  
          ServiceAccountCredential credential = new ServiceAccountCredential(
            new ServiceAccountCredential.Initializer(/*My Service Account */)
            {
                Scopes = new string[] { CalendarService.Scope.Calendar }
            }.FromCertificate(certificate));
  
          // Create Google Calendar API service.
          var service = new CalendarService(new BaseClientService.Initializer()
          {
              HttpClientInitializer = credential,
              ApplicationName = "Test",
          });
  
              EventsResource.ListRequest request = service.Events.List("primary");
              request.TimeMin = DateTime.Now;
              request.ShowDeleted = false;
              request.SingleEvents = true;
              request.MaxResults = 10;
              request.OrderBy = EventsResource.ListRequest.OrderByEnum.StartTime;
  
              // List events.
              Events events = request.Execute();
  </code></pre>