[英]connection Azure DevOps using REST API
我正在嘗試使用以下代碼連接 .net 核心應用程序中的 Azure DevOps。
var url = new Uri("https://abcdxyz.visualstudio.com");
var PAT = "XXXXXgdeuxfroaqho4lhtqjdvbagrotypfgfhtuq6w23ie5z3xoq";
VssConnection connection = new VssConnection(url, new VssBasicCredential(string.Empty, PAT));
WorkItemTrackingHttpClient witClient = connection.GetClient<WorkItemTrackingHttpClient>();
它成功構建。 但是,它會拋出錯誤
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Net.Http.WebRequest, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.'
我試圖更新 Nuget 包。 但是還是會出現這個錯誤。
你能告訴我如何解決這個問題嗎? 謝謝
我記得有一個類似的問題,這是我們在使用這些庫的 .net 核心應用程序中獲取 WIT 客戶端的方式:
vss = new VssBasicCredential(string.Empty, PAT);
VssConnection connection = new VssConnection(tfsURI, vss);
witClient = connection.GetClient<WorkItemTrackingHttpClient>();
workItemClient = new WorkItemClient(witClient);
我們也在使用Microsoft.TeamFoundationServer.Client
和Microsoft.VisualStudio.Services.Client
庫的預覽版。
據我所知,沒有 .net core 支持 ATM。 我的一位同事評論了這個懸而未決的問題,並提供了更多關於我們如何進行這項工作的背景。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.