error CS1674: 'void': type used in a using statement must be implicitly convertible to 'System.IDisposable'
See original GitHub issuethe 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:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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 😃
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…