Forum Discussion

sarahmeinie's avatar
sarahmeinie
Copper Contributor
Dec 01, 2023

Error when doing query for drives on Sharepoint using Microsoft Graph in C#

I have this line of code

 

Running on an app registration with these permissions

 

 

In a basic .NET Core 7 app with added Microsoft.Graph client configured like this

 

Sometimes this finds a drive for a given folderName successfully and other times, for the exact same folder name, it throws a general exception.

 

It returns exception:

General exception while processing at 

  • Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.ThrowIfFailedResponse(HttpResponseMessage response, Dictionary`2 errorMapping, Activity activityForAttributes, CancellationToken cancellationToken) at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken)
       at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken)
       at Microsoft.Graph.Drives.Item.SearchWithQ.SearchWithQRequestBuilder.GetAsSearchWithQGetResponseAsync(Action`1 requestConfiguration, CancellationToken cancellationToken)

 

What am I missing?

Thanks in advance!

  • sarahmeinie's avatar
    sarahmeinie
    Copper Contributor

    For anyone interested, downgrading our Microsoft.Graph package to 4.48 resolved this issue. The bug is on Microsofts side and was introduced sometime after version 4.48. Hope this gets addressed by Microsoft soon.

Resources