question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error CS1674: 'void': type used in a using statement must be implicitly convertible to 'System.IDisposable'

See original GitHub issue

the following code fails on .net core 1.1 (in a controller):

public async Task<string> testAsync([FromServices] IManagedTracer tracer)
{
            using (tracer.StartSpan(nameof(testAsync)))
            {
...
            }
}

compile error: error CS1674: 'void': type used in a using statement must be implicitly convertible to 'System.IDisposable'

the documentation says we can use it: http://googlecloudplatform.github.io/google-cloud-dotnet/docs/Google.Cloud.Diagnostics.AspNetCore/ Am I missing something?

(sorry to spam issues)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jskeetcommented, Mar 30, 2017

@Jonathan34: I’d love to take credit for it being a really quick fix, but I spent many hours today sorting out the release - it was almost all ready by the time this was raised 😃

1reaction
jskeetcommented, Mar 30, 2017

I suspect this is a matter of the documentation being ahead of the released libraries. I’m in the middle of preparing a release (the first for a few weeks). If you can hold off a little while, this may just fix itself…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Implicitly convertible to 'System.IDisposable' error
IDisposable error occurs because the connection you are trying to open might not close automatically, when out of scope of where the connection ......
Read more >
C# – Error – “type used in a using statement must be implicitly ...
'Person':type used in a using statement must be implicitly convertible to 'System.IDisposable'. Scenario #1. A very simple scenario. We have a ...
Read more >
Compiler Error CS1674
In this article. Example 1; Example 2; Example 3. 'T': type used in a using statement must be implicitly convertible to 'System.IDisposable'.
Read more >
having Error : type used in a using statement must be ...
Solution 1​​ Error is clear. That means MySqlBackup is not inherited from IDisposable . So, you can't use that with using statement. Change...
Read more >
❤ 💻 C# - Error CS1674 "ILogger": The type used in ...
C# - Error CS1674 "ILogger": The type used in the using statement must be implicitly convertible to the interface "System.IDisposable" ; namespace ConsoleApp....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found