Describe the bug
When a GraphServiceClient is constructed without an externally‑supplied HttpClient, BaseGraphRequestAdapter eagerly creates one via GraphClientFactory.Create(...) and forwards it to the base Kiota HttpClientRequestAdapter.
Kiota records createdClient = false (because, from its perspective, the caller supplied the client), so HttpClientRequestAdapter.Dispose() never disposes it.
BaseGraphRequestAdapter does not override Dispose and does not retain a reference to clean up itself.
The HttpClient - together with its HttpMessageHandler and connection pool - is therefore leaked.
Wrapping the GraphServiceClient in using does not fix the leak: the dispose chain reaches Kiota, which deliberately skips the HttpClient because createdClient == false.
Expected behavior
Disposable resources should be disposed.
How to reproduce
just create a GraphServiceClient
var graph = new GraphServiceClient(cred, new[] { "https://graph.microsoft.com/.default" });
SDK Version
5.104.0
Latest version known to work for scenario above?
No response
Known Workarounds
supply your own HttpClient (and dispose of it yourself)
private readonly HttpClient _httpClient = GraphClientFactory.Create();
using var graph = new GraphServiceClient(_httpClient, credential, scopes);
Debug output
Click to expand log
```
</details>
### Configuration
_No response_
### Other information
_No response_
Describe the bug
When a
GraphServiceClientis constructed without an externally‑suppliedHttpClient,BaseGraphRequestAdaptereagerly creates one viaGraphClientFactory.Create(...)and forwards it to the base KiotaHttpClientRequestAdapter.Kiota records
createdClient = false(because, from its perspective, the caller supplied the client), soHttpClientRequestAdapter.Dispose()never disposes it.BaseGraphRequestAdapterdoes not overrideDisposeand does not retain a reference to clean up itself.The
HttpClient- together with itsHttpMessageHandlerand connection pool - is therefore leaked.Wrapping the
GraphServiceClientinusingdoes not fix the leak: the dispose chain reaches Kiota, which deliberately skips the HttpClient becausecreatedClient == false.Expected behavior
Disposable resources should be disposed.
How to reproduce
just create a
GraphServiceClientSDK Version
5.104.0
Latest version known to work for scenario above?
No response
Known Workarounds
supply your own HttpClient (and dispose of it yourself)
Debug output
Click to expand log
```