You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.
Currently the clients implement IDisposable, which indicates to the user that they should be disposing of these objects after they have been used.
However doing so causes you to start receiving ObjectDisposedExceptions on further attempts to get a new client and then use it. Here is code to reproduce
static async Task Main(string[] args)
{
var creds = new VssBasicCredential("", "PAT");
var conn = new VssConnection(new Uri("https://org.visualstudio.com"),creds);
using (var git1 = await conn.GetClientAsync<GitHttpClient>())
{
var item = await git1.GetItemAsync("PROJECT", "REPO", "/File.json", null, null,
null, null, true, new GitVersionDescriptor() {Version = "master"}, true);
}
using (var git2 = await conn.GetClientAsync<GitHttpClient>())
{
var item = await git2.GetItemAsync("PROJECT", "REPO", "/File.json", null, null,
null, null, true, new GitVersionDescriptor() { Version = "master" }, true);
}
}
I see this mentioned in #266 - but to me this is either a bug or a design flaw.
Can you please clarify when these objects should be disposed?
The text was updated successfully, but these errors were encountered:
Currently the clients implement IDisposable, which indicates to the user that they should be disposing of these objects after they have been used.
However doing so causes you to start receiving
ObjectDisposedExceptions
on further attempts to get a new client and then use it. Here is code to reproduceI see this mentioned in #266 - but to me this is either a bug or a design flaw.
Can you please clarify when these objects should be disposed?
The text was updated successfully, but these errors were encountered: