E
Eleftheria Anastasopoulou
Guest
Hello,
I am using Azure DevOps REST APIs to download locally some team projects.
The way I am doing it is described below:
using (var client = new TfvcHttpClient(new Uri(azureUri), credentials))
{
var itemRequestData = Create("$/" + teamProjectReference.Name);
Stream item = client.GetItemsBatchZipAsync(itemRequestData, teamProjectReference.Id).Result;
SaveZippedContent(@path, item);
}
The above is working fine for all the projects except for one. The exception thrown is:
Error: System.AggregateException: One or more errors occurred. ---> Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Invalid attempt to call Read when reader is closed. ---> System.InvalidOperationException: Invalid attempt to call Read when reader is closed.
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<HandleResponseAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__51.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.TeamFoundation.SourceControl.WebApi.TfvcHttpClientBase.<GetItemsBatchZipAsync>d__31.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at BackUpAzureDevOpsTfvc.Program.DownloadProject(String azureUri, VssBasicCredential credentials, TeamProjectReference teamProjectReference, String path) in ...
---> (Inner Exception #0) Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Invalid attempt to call Read when reader is closed. ---> System.InvalidOperationException: Invalid attempt to call Read when reader is closed.
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<HandleResponseAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__51.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.TeamFoundation.SourceControl.WebApi.TfvcHttpClientBase.<GetItemsBatchZipAsync>d__31.MoveNext()<---
What could be the cause of this exception?
Thank you in advance,
Eleftheria Anastasopoulou
Continue reading...
I am using Azure DevOps REST APIs to download locally some team projects.
The way I am doing it is described below:
using (var client = new TfvcHttpClient(new Uri(azureUri), credentials))
{
var itemRequestData = Create("$/" + teamProjectReference.Name);
Stream item = client.GetItemsBatchZipAsync(itemRequestData, teamProjectReference.Id).Result;
SaveZippedContent(@path, item);
}
The above is working fine for all the projects except for one. The exception thrown is:
Error: System.AggregateException: One or more errors occurred. ---> Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Invalid attempt to call Read when reader is closed. ---> System.InvalidOperationException: Invalid attempt to call Read when reader is closed.
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<HandleResponseAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__51.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.TeamFoundation.SourceControl.WebApi.TfvcHttpClientBase.<GetItemsBatchZipAsync>d__31.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at BackUpAzureDevOpsTfvc.Program.DownloadProject(String azureUri, VssBasicCredential credentials, TeamProjectReference teamProjectReference, String path) in ...
---> (Inner Exception #0) Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Invalid attempt to call Read when reader is closed. ---> System.InvalidOperationException: Invalid attempt to call Read when reader is closed.
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<HandleResponseAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__51.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.TeamFoundation.SourceControl.WebApi.TfvcHttpClientBase.<GetItemsBatchZipAsync>d__31.MoveNext()<---
What could be the cause of this exception?
Thank you in advance,
Eleftheria Anastasopoulou
Continue reading...