![]() |
VOOZH | about |
dotnet add package Microsoft.Graph.Core --version 4.0.1
NuGet\Install-Package Microsoft.Graph.Core -Version 4.0.1
<PackageReference Include="Microsoft.Graph.Core" Version="4.0.1" />
<PackageVersion Include="Microsoft.Graph.Core" Version="4.0.1" />Directory.Packages.props
<PackageReference Include="Microsoft.Graph.Core" />Project file
paket add Microsoft.Graph.Core --version 4.0.1
#r "nuget: Microsoft.Graph.Core, 4.0.1"
#:package Microsoft.Graph.Core@4.0.1
#addin nuget:?package=Microsoft.Graph.Core&version=4.0.1Install as a Cake Addin
#tool nuget:?package=Microsoft.Graph.Core&version=4.0.1Install as a Cake Tool
Integrate the Microsoft Graph API into your .NET project!
The Microsoft Graph .NET Core Client Library contains core classes and interfaces used by Microsoft.Graph Client Library to send native HTTP requests to Microsoft Graph API. The latest core client library targets .NetStandard 2.0.
To install the client library via NuGet:
Microsoft.Graph.Core in the NuGet Library, orInstall-Package Microsoft.Graph.Core into the Package Manager Console.Register your application to use Microsoft Graph API by following the steps at Register your application with the Microsoft identity platform.
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.
You can create an instance of HttpClient that is pre-configured for making requests to Microsoft Graph APIs using GraphClientFactory.
// The client credentials flow requires that you request the
// /.default scope, and pre-configure your permissions on the
// app registration in Azure. An administrator must grant consent
// to those permissions beforehand.
var scopes = new[] { "https://graph.microsoft.com/.default" };
// Values from app registration
var clientId = "YOUR_CLIENT_ID";
var tenantId = "YOUR_TENANT_ID";
var clientSecret = "YOUR_CLIENT_SECRET";
// using Azure.Identity;
var options = new ClientSecretCredentialOptions
{
AuthorityHost = AzureAuthorityHosts.AzurePublicCloud,
};
// https://learn.microsoft.com/dotnet/api/azure.identity.clientsecretcredential
var clientSecretCredential = new ClientSecretCredential(
tenantId, clientId, clientSecret, options);
HttpClient httpClient = GraphClientFactory.create(tokenCredential: clientSecretCredential, version: "beta");
For more information on initializing a client instance, see the library overview
Once you have an authenticated HttpClient, you can begin to make calls to the service. The requests to the service follows our REST API syntax.
For example, to retrieve a user's default drive:
HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, "me/drive");
HttpResponseMessage response = await httpClient.SendAsync(requestMessage);
if (response.IsSuccessStatusCode)
{
string jsonResponse = await response.Content.ReadAsStringAsync();
}
To get the current user's root folder of their default drive:
HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, "me/drive/root");
HttpResponseMessage response = await httpClient.SendAsync(requestMessage);
if (response.IsSuccessStatusCode)
{
string jsonResponse = await response.Content.ReadAsStringAsync();
}
Install System.Runtime.InteropServices.RuntimeInformation before you install Microsoft.Graph >=1.3 if you are having an issue updating the package for a Xamarin solution. You may need to updated references to Microsoft.NETCore.UniversalWindowsPlatform to >=5.2.2 as well.
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 projectRun
dotnet build -p:IncludeMauiTargets=trueif you wish to build the MAUI targets for the projects as well.
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 is compatible. 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.Core:
| Package | Downloads |
|---|---|
|
Microsoft.Graph
Microsoft Graph Client Library allows you to call Office 365, Azure AD and other Microsoft services through a single unified developer experience. |
|
|
Microsoft.Graph.Auth
Microsoft Graph Authentication Library implements authentication functionality used by Microsoft Graph Client Library. It provides a set of OAuth scenario-centric providers that implement Microsoft.Graph.IAuthenticationProvider and uses Microsoft Authentication Library (MSAL) to handle access token acquisition and storage. |
|
|
Microsoft.Graph.Beta
Microsoft Graph beta client library allows you to target the Microsoft Graph /beta endpoint. You can call Office 365, Azure AD and other Microsoft services through a single unified developer experience. |
|
|
Microsoft.Graph.Communications.Core
Microsoft Graph Communications Client Core Library - This library builds on the Microsoft.Graph SDK to provide better support for the Communications APIs. |
|
|
Microsoft.Graph.Communications.Common
Microsoft Graph Communications Client Library - Common utilites for transport, logging, telemetry, state machines, argument validation, and OData. |
Showing the top 20 popular GitHub repositories that depend on Microsoft.Graph.Core:
| Repository | Stars |
|---|---|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
|
ONLYOFFICE/CommunityServer
Free open source office suite with business productivity tools: document and project management, CRM, mail aggregator.
|
|
|
netwrix/pingcastle
PingCastle - Get Active Directory Security at 80% in 20% of the time
|
|
|
pnp/PnP
SharePoint / Office 365 Developer Patterns and Practices - Archived older solutions. Please see https://aka.ms/m365pnp for updated guidance
|
|
|
pnp/PnP-PowerShell
SharePoint PnP PowerShell CmdLets
|
|
|
microsoftgraph/msgraph-sdk-powershell
Powershell SDK for Microsoft Graph
|
|
|
microsoftgraph/msgraph-sdk-dotnet
Microsoft Graph Client Library for .NET!
|
|
|
Kyrodan/KeeAnywhere
A cloud storage provider plugin for KeePass Password Safe
|
|
|
pnp/PnP-Tools
Scripts and tools for Office 365 and SharePoint - More for IT Pro's
|
|
|
pnp/PnP-Sites-Core
Microsoft 365 Dev PnP Core component (.NET) targeted for increasing developer productivity with CSOM based solutions.
|
|
|
OfficeDev/microsoft-teams-apps-company-communicator
Company Communicator app template
|
|
|
viciousviper/DokanCloudFS
A virtual filesystem for various publicly accessible Cloud storage services on the Microsoft Windows platform.
|
|
|
OneDrive/onedrive-sdk-csharp
OneDrive SDK for C#! https://dev.onedrive.com
|
|
|
nheiniger/SnaffPoint
A tool for pointesters to find candies in SharePoint
|
|
|
239573049/ChatGpt.Desktop
ChatGpt Dekstop support Android,IOS,Mac,Linux,Win,Web
|
|
| shr670377723/CommunityServer-master | |
|
Rambalac/ACDDokanNet
Dokan.NET based driver for Amazon Cloud Drive
|
|
|
GridProtectionAlliance/gsf
Grid Solutions Framework
|
|
|
microsoft/Agents-for-net
This repository is for active development of the Microsoft 365 Agent SDK components for .NET
|
|
|
pnp/modernization
All modernization tooling and guidance
|
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1 | 1,074,589 | 5/9/2026 |
| 3.2.5 | 8,679,996 | 12/19/2025 |
| 3.2.4 | 22,856,587 | 3/12/2025 |
| 3.2.3 | 5,318,835 | 1/30/2025 |
| 3.2.2 | 2,791,551 | 1/10/2025 |
| 3.2.1 | 6,384,391 | 11/20/2024 |
| 3.2.0 | 176,438 | 11/8/2024 |
| 3.1.22 | 6,075,242 | 9/26/2024 |
| 3.1.21 | 1,725,240 | 9/4/2024 |
| 3.1.20 | 98,595 | 8/28/2024 |
| 3.1.19 | 708,288 | 8/26/2024 |
| 3.1.18 | 22,656 | 8/26/2024 |
| 3.1.17 | 69,569 | 8/19/2024 |
| 3.1.16 | 31,328 | 8/15/2024 |
| 3.1.15 | 77,773 | 8/9/2024 |
| 3.1.14 | 175,778 | 7/24/2024 |
| 3.1.13 | 245,479 | 7/3/2024 |
| 3.1.12 | 8,942,872 | 5/28/2024 |
| 3.1.11 | 3,814,991 | 4/30/2024 |