Azure DevOps 2019/2020本地版GraphClient缺失及技术求助
Let's break down your problem and cover both the solution for the GraphHttpClient error and reliable ways to reach the Azure DevOps team.
Understanding the Graph API Gap in On-Prem Servers
First, it's important to note that the Graph API (and GraphHttpClient) was not fully rolled out to Azure DevOps Server 2019 or 2020 RC—this is why you're hitting the VssResourceNotFoundException error. The cloud version has full support, but on-prem releases from that era lagged behind in this area.
Solution 1: Workarounds for User/Graph Data on On-Prem Servers
Since the REST Graph client isn't available, you have two viable workarounds:
Option A: Continue Using the Deprecated SOAP API (For 2019/2020 RC)
Even though Microsoft deprecated the SOAP API for 2019, it's still functional on both 2019 and 2020 RC servers. You can keep using it to fetch UserGraph and user data until you can upgrade to a newer on-prem version.
Option B: Use the Legacy Identity REST API
Instead of the Graph API, use the Identity REST API which is fully supported on 2019 and 2020 RC. With the Microsoft.VisualStudio.Services.Client library, you can use IdentityHttpClient instead of GraphHttpClient—this client works reliably on on-prem servers. Here's a quick example:
using var identityClient = vssConnection.GetClient<IdentityHttpClient>(); var identities = await identityClient.ReadIdentitiesAsync( searchFilter: IdentitySearchFilter.General, searchValue: "*", queryMembership: QueryMembership.None);
This will return user identities that you can map to the data you need from the Graph API.
Solution 2: Long-Term Fix - Upgrade to a Supported On-Prem Version
If possible, upgrading to Azure DevOps Server 2022 or later is the best long-term fix. These versions include full support for the Graph API and GraphHttpClient, aligning much closer to the cloud functionality.
Contacting the Azure DevOps Team
To get direct support or report this API gap, here are the most reliable channels:
- Azure DevOps Support Portal: If you have a paid support plan (even for on-prem servers), you can open a support ticket directly through your organization's Azure Portal. This gives you direct access to Microsoft's engineering team.
- Azure DevOps Developer Community: Post your issue on the Azure DevOps Developer Community forum. The Azure DevOps team actively monitors this space, and other community members may also share workarounds.
- GitHub Issues: For API-specific issues, you can open an issue in the official azure-devops-dotnet-sdk GitHub repository. The SDK team responds to valid on-prem compatibility issues here.
Additional Notes
- Your code works on Azure DevOps Cloud because the Graph API is fully deployed there, but on-prem releases from 2019/2020 RC never received full Graph API support.
- Enabling SSL and using Basic auth is recommended for on-prem servers, but it won't resolve the missing Graph API resource issue—that's a core platform limitation of those older on-prem versions.
内容的提问来源于stack exchange,提问作者Nickname0222022022

