How to create folder in Google Drive using .NET API?

.net, c#, google-drive-api

Solution

A folder can be treated as a file with a special MIME type: "application/vnd.google-apps.folder".

The following C# code should be what you need:

File body = new File();
body.Title = "document title";
body.Description = "document description";
body.MimeType = "application/vnd.google-apps.folder";

// service is an authorized Drive API service instance
File file = service.Files.Insert(body).Fetch();

For more details check the docs: https://developers.google.com/drive/folder

Problem

I am using C#, Google .NET API. How can I create a folder in Google Drive root location? Any code will be helpful. Thanks

Original source