title: Google DriveService Files.List() not returning results
body: <h2>Edit:</h2>
  <p>I've tried granting the SA access to my personal drive (within the organization Workspace) to do some troubleshooting. After granting rights to the SA to a particular folder and rewriting the code to examine that folder, it successfully returned information about files within the test folder. The conclusion is the SA has been set-up correctly by our IT department and does have adequate scope and rights to read files in our organizations Workspace. So, the questions remain: why can't it return information about files in a Shared Drive? What other parameters need to be set in order to get it to return those files? Are there entirely other functions that need to be used? I did notice the deprecated TeamDrives.List() function, but the guidance when trying to use it was to use Files.List() as I had written originally.</p>
  <h2>--- end edit ---</h2>
  <p>We have a Google Workspace environment. I've been granted a Service Account (SA) by our IT department and am trying to use it to help maintain access rights. The SA has been granted Content Manager rights to a shared drive instance.
  I've tried following along <a href="https://www.youtube.com/watch?v=VQOrkZrZXB8" rel="nofollow noreferrer">this</a> YouTube tutorial. In stepping through the code execution, it appears to log in correctly, but it is not returning any files. I've tried substituting the full URL for the file ID of the root folder I'd like to examine, but then it returns a 404 error, so I think it is finding the correct folder.
  If the file ID is used the code runs without errors, it simply returns no files (and there are hundreds of folders and files within the root).
  Any suggestions?</p>
  <pre><code>namespace DriveQuickstart
  </code></pre>
  <p>{
  class Program</p>
  <pre><code>{
  
      static string[] Scopes = { DriveService.Scope.DriveReadonly };
      private const string PathToServiceAccountKeyFile = @&quot;&lt;path to jason Service Account file&gt;&quot;;
      private const string ServiceAccountEmail = @&quot;&lt;Service Account &quot;email&quot;&gt;&quot;;
              static void Main(string[] args)
      {
          MainAsync().Wait();
      }
      static async Task MainAsync()
      {
          var credential = GoogleCredential.FromFile(PathToServiceAccountKeyFile)
                          .CreateScoped(new[] { DriveService.ScopeConstants.Drive });
          var service = new DriveService(new BaseClientService.Initializer()
          {
              HttpClientInitializer = credential
          });
          var request = service.Files.List();
          request.IncludeItemsFromAllDrives = true;
          request.SupportsAllDrives = true;
          request.Q = &quot;parents in '&lt;id of &quot;root&quot; folder in shared drive&gt;'&quot;;
          FileList results = await request.ExecuteAsync();
  
          foreach (var driveFile in results.Files)
          {
              Console.WriteLine($&quot;{driveFile.Name}  {driveFile.MimeType}  {driveFile.Id}&quot;);
          }
      }
  }
  </code></pre>
  <p>}</p>