A C# library that simplifies interaction with the Google Drive API. It doesn't cover the entire API; it wraps the most commonly used endpoints (files, folders, trash, upload/download) behind a clean, fluent interface.
🚧 Pre-release: approaching v1.0.0. Not yet published to NuGet; first preview is in progress. See the Roadmap for status.
Not yet on NuGet. Clone the repo and reference the project directly:
git clone https://github.com/Illia1F/GoogleDriveApi-DotNet.git<ProjectReference Include="path/to/src/GoogleDriveApi-DotNet.csproj" />Coming soon: once the first preview ships, install with:
dotnet add package GoogleDriveApi.DotNet --prerelease(dependenciesGoogle.Apis.Drive.v3andMimeMappingare pulled in transitively).
using GoogleDriveApi_DotNet;
using MimeMapping;
// Authorizes on build (opens a browser the first time).
using GoogleDriveApi gDriveApi = await GoogleDriveApi.CreateBuilder()
.SetCredentialsPath("credentials.json")
.SetApplicationName("My Drive App")
.BuildAsync();
string folderId = await gDriveApi.Folders.CreateAsync("My Folder");
string fileId = await gDriveApi.Transfers.UploadAsync("photo.jpg", KnownMimeTypes.Jpeg, folderId);
await gDriveApi.Transfers.DownloadAsync(fileId, "Downloads");You need a Google Cloud project and a credentials.json first; see
Getting Started.
This library is not a full reflection of the real Google Drive API — it implements the most commonly used endpoints to simplify everyday interaction with Google Drive.
Runnable projects in samples/:
- Console: FileUploader, FileDownloader, FileManagement, FolderManagement, TrashOperations, RetrieveAllFolderHierarchy
- Desktop: GDriveExplorerWinForms, a WinForms Drive explorer that covers nearly the whole API surface.
To run a sample, place your
credentials.jsoninsamples/Shared. To share more files across samples, add them to theDirectory.Build.targetsconfig.
MIT. See LICENSE.