![]() |
VOOZH | about |
dotnet add package Microsoft.Graph --version 6.2.0
NuGet\Install-Package Microsoft.Graph -Version 6.2.0
<PackageReference Include="Microsoft.Graph" Version="6.2.0" />
<PackageVersion Include="Microsoft.Graph" Version="6.2.0" />Directory.Packages.props
<PackageReference Include="Microsoft.Graph" />Project file
paket add Microsoft.Graph --version 6.2.0
#r "nuget: Microsoft.Graph, 6.2.0"
#:package Microsoft.Graph@6.2.0
#addin nuget:?package=Microsoft.Graph&version=6.2.0Install as a Cake Addin
#tool nuget:?package=Microsoft.Graph&version=6.2.0Install as a Cake Tool
👁 Validate Pull Request
👁 NuGet Version
Integrate the Microsoft Graph API into your .NET project!
The Microsoft Graph .NET Client Library targets .NetStandard 2.0.
To install the client library via NuGet:
Microsoft.Graph in the NuGet Library, orInstall-Package Microsoft.Graph into the Package Manager Console.Register your application to use Microsoft Graph API using the Microsoft Application Registration Portal.
The Microsoft Graph .NET Client Library supports the use of TokenCredential classes in the Azure.Identity library.
You can read more about available Credential classes here and examples on how to quickly setup TokenCredential instances can be found here.
The recommended library for authenticating against Microsoft Identity (Azure AD) is MSAL.
For an example of authenticating a UWP app using the V2 Authentication Endpoint, see the Microsoft Graph UWP Connect Library.
An instance of the GraphServiceClient class handles building requests,
sending them to Microsoft Graph API, and processing the responses. To create a
new instance of this class, you need to provide an instance of
IAuthenticationProvider which can authenticate requests to Microsoft Graph.
For more information on initializing a client instance, see the library overview
Once you have completed authentication and have a GraphServiceClient, you can begin to make calls to the service. The requests in the SDK follow the format of the Microsoft Graph API's RESTful syntax.
For example, to retrieve a user's default drive:
var drive = await graphClient.Me.Drive.GetAsync();
GetAsync will return a Drive object on success and throw a
ApiException on error.
To get the current user's root folder of their default drive:
// Get the user's driveId
var drive = await graphClient.Me.Drive.GetAsync();
var userDriveId = drive.Id;
// use the driveId to get the root drive
var rootItem = await graphClient.Drives[userDriveId].Root.GetAsync();
GetAsync will return a DriveItem object on success and throw a
ApiException on error.
For a general overview of how the SDK is designed, see overview.
The following sample applications are also available:
The Microsoft Graph .NET Client Library is scheduled to be updated during the second and fourth week of each month
Between 1.x and 3.x there were some minor possibly breaking changes:
netStandard1.3 to netstandard2.0net45 to net461GiphyRatingTypeParticipantInfo became InvitationParticipantInfoCallRecordRequestBody became CallRecordResponseRequestBodyBetween 3.x and 4.x there were some major breaking changes:
netStandard1.3 to netstandard2.0net45 to net462View the upgrade guide here.
Between 4.x and 5.x there were several major breaking changes as the SDK now uses Kiota for code generation.
View the upgrade guide here.
To view or log issues, see issues.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.
If you are looking to build the library locally for the purposes of contributing code or running tests, you will need to:
dotnet restore from the command line in your package directorynuget restore and msbuild from CLI or run Build from Visual Studio to restore Nuget packages and build the projectDue to long file names you may need to run
git config --system core.longpaths truebefore cloning the repo to your system.
Additionally for Windows OS, set the value of the parameter
HKLM\SYSTEM\CurrentControlSet\Control\FileSystemLongPathsEnabledto1, before opening the solution in VS
Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT . See Third Party Notices for information on the packages referenced via NuGet.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Microsoft.Graph:
| Package | Downloads |
|---|---|
|
Microsoft.Identity.Web.MicrosoftGraph
This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users and call Microsoft Graph, and for protected web APIs that call Microsoft Graph. |
|
|
GSF.Security
Library of core security framework for implementing role-based security with integrated Active Directory, local account and database style authentication across various .NET application types. |
|
|
Microsoft.Identity.Web.GraphServiceClient
This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users and call Microsoft Graph, and for protected web APIs that call Microsoft Graph. Works specifically with MS Graph SDK v5 and above. For MS Graph SDK v4 support, please use Microsoft.Identity.Web.MicrosoftGraph. |
|
|
Rystem.Content.Infrastructure.M365.Sharepoint
Rystem.Content helps you to integrate with azure services or to create an abstraction layer among your infrastructure and your business. |
|
|
SharePointPnPCoreOnline
Retired - please use PnP Framework (https://github.com/pnp/pnpframework) going forward. Core CSOM extension methods for SharePoint Online add-in model development. This will increase productivity of the developers by abstracting complex operations. |
Showing the top 20 popular GitHub repositories that depend on Microsoft.Graph:
| Repository | Stars |
|---|---|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
|
unoplatform/uno
Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
|
|
|
PhilippC/keepass2android
Password manager app for Android
|
|
|
Azure/azure-sdk-for-net
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
|
|
|
lukencode/FluentEmail
All in one email sender for .NET. Supports popular senders (SendGrid, MailGun, etc) and Razor templates.
|
|
|
microsoft/onefuzz
A self-hosted Fuzzing-As-A-Service platform
|
|
|
phongnguyend/Practical.CleanArchitecture
Full-stack .Net 10 Clean Architecture (Microservices, Modular Monolith, Monolith), Blazor, Angular 21, React 19, Vue 3.5, BFF with YARP, NextJs 16, Domain-Driven Design, CQRS, SOLID, Asp.Net Core Identity Custom Storage, OpenID Connect, EF Core, OpenTelemetry, SignalR, Background Services, Health Checks, Rate Limiting, Clouds (Azure, AWS, GCP), ...
|
|
|
s1t5/mail-archiver
Mail-Archiver is a web application for archiving, searching, and exporting emails from multiple accounts. Featuring folder sync, attachment support, mailbox migration and a dashboard.
|
|
|
pnp/PnP
SharePoint / Office 365 Developer Patterns and Practices - Archived older solutions. Please see https://aka.ms/m365pnp for updated guidance
|
|
|
microsoft/WhatTheHack
A collection of challenge based hack-a-thons including student guide, coach guide, lecture presentations, sample/instructional code and templates. Please visit the What The Hack website at: https://aka.ms/wth
|
|
|
microsoft/Recognizers-Text
Microsoft.Recognizers.Text provides recognition and resolution of numbers, units, date/time, etc. in multiple languages (ZH, EN, FR, ES, PT, DE, IT, TR, HI, NL. Partial support for JA, KO, AR, SV). Packages available at: https://www.nuget.org/profiles/Recognizers.Text, https://www.npmjs.com/~recognizers.text
|
|
|
ariacom/Seal-Report
Database Reporting Tool and Tasks (.Net)
|
|
|
bkaankose/Wino-Mail
Built-in Mail & Calendars app clone for Windows.
|
|
|
pnp/PnP-PowerShell
SharePoint PnP PowerShell CmdLets
|
|
|
azure-ad-b2c/samples
Azure AD B2C custom policy solutions and samples.
|
|
|
OfficeDev/TrainingContent
Training Content used for developer.microsoft.com/office
|
|
|
pnp/powershell
PnP PowerShell
|
|
|
JonPSmith/AuthPermissions.AspNetCore
This library provides extra authorization and multi-tenant features to an ASP.NET Core application.
|
|
|
dotnet/Scaffolding
Code generators to speed up development.
|
|
|
paillave/Etl.Net
Mass processing data with a complete ETL for .net developers
|
| Version | Downloads | Last Updated |
|---|---|---|
| 6.2.0 | 155,984 | 6/8/2026 |
| 6.1.0 | 526,601 | 5/20/2026 |
| 6.0.3 | 304,761 | 5/14/2026 |
| 5.105.0 | 1,218,872 | 4/30/2026 |
| 5.104.0 | 694,984 | 4/17/2026 |
| 5.103.0 | 3,628,945 | 2/20/2026 |
| 5.102.0 | 1,374,896 | 2/5/2026 |
| 5.101.0 | 910,698 | 1/22/2026 |
| 5.100.0 | 972,779 | 1/7/2026 |
| 5.99.0 | 848,366 | 12/18/2025 |
| 5.98.0 | 711,982 | 12/4/2025 |
| 5.97.0 | 1,377,378 | 11/19/2025 |
| 5.96.0 | 975,190 | 11/6/2025 |
| 5.95.0 | 1,031,765 | 10/23/2025 |
| 5.94.0 | 1,171,306 | 10/6/2025 |
| 5.93.0 | 1,416,248 | 9/16/2025 |
| 5.92.0 | 562,597 | 9/10/2025 |
| 5.91.0 | 1,441,808 | 8/20/2025 |
| 5.90.0 | 659,888 | 8/12/2025 |
| 5.89.0 | 804,368 | 8/5/2025 |