![](/img/trans.png)
[英]Stepping over one method in the debugger but continuing normal debugging after
[英]Debugger not stepping over/into async/wait
我正在單獨測試一些代碼,它運行得很好——調試器逐行檢查每一行並返回預期結果。 這是我正在單獨測試的一些代碼:
static async Task<List<string>> GetExclusionDataAsync(Uri blobUri)
{
var listOfExclusions = new List<string>();
var blobDownloadInfo = await StreamBlobData(blobUri);
using (StreamReader reader = new StreamReader(blobDownloadInfo.Content))
{
while (!reader.EndOfStream)
{
string exclusionRow = reader.ReadLine();
listOfExclusions.Add(exclusionRow);
}
}
return listOfExclusions;
}
private static async Task<BlobDownloadInfo> StreamBlobData(Uri blobPathUri)
{
BlobClient blobClient = new BlobClient(blobPathUri);
BlobDownloadInfo blobDownloadInfo = await blobClient.DownloadAsync();
return blobDownloadInfo;
}
我已將此測試代碼(幾乎)完全復制到另一個更大的開發人員中。 解決方案。 當我在 BlobClient 上設置斷點時BlobClient blobClient = new BlobClient(blobPathUri);
line, debug, and try step over/into this line, debugger 跳過方法中代碼的 rest 並跳回沒有預期數據的先前方法。 見下文:
調試器從第 75 行開始。
然后我跨過/進入,調試器跳到沒有數據的第 60 行(調用方法)。
我該如何解決這個問題/發生了什么?
我不熟悉異步編程和從 blob 存儲中檢索內容。 提前致謝!
我正在添加解決此問題的答案。
要進入/結束,您需要將 package azure.storage.blobs 安裝到您的調用項目中,因此它只是參考相關的。 然后在調試期間,您可以進入/越過它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.