Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error CS1674: 'Options': type used in a using statement mu st be implicitly convertible to 'System.IDisposable'. #41607

Closed
dudhatjanvi opened this issue Jul 1, 2024 · 1 comment
Labels
dotnet-csharp/svc errors-warnings/subsvc Pri2 product-feedback Indicates issues that are related to product issues, not docs [org][type][category]

Comments

@dudhatjanvi
Copy link

Type of issue

Code doesn't work

Description

[Enter feedback here]
using (Options options = new Option()) this new option object not consider in dt search std version
it's showing error like this : error CS1674: 'Options': type used in a using statement mu
st be implicitly convertible to 'System.IDisposable'.

Page URL

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs1674

Content source URL

https://github.com/dotnet/docs/blob/main/docs/csharp/language-reference/compiler-messages/cs1674.md

Document Version Independent Id

a692e362-ba9b-5163-b268-de1c90c77633

Article author

@BillWagner

Metadata

  • ID: 91bc4df9-abde-65e4-366e-9fa61440f038
  • Service: dotnet-csharp
  • Sub-service: errors-warnings
@BillWagner
Copy link
Member

BillWagner commented Jul 1, 2024

Hi @dudhatjanvi

To fix the error, the Options type must implement IDisposable:

public class Options : IDisposable
{
}

I'll close this.

@BillWagner BillWagner added the product-feedback Indicates issues that are related to product issues, not docs [org][type][category] label Jul 1, 2024
@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-csharp/svc errors-warnings/subsvc Pri2 product-feedback Indicates issues that are related to product issues, not docs [org][type][category]
Projects
None yet
Development

No branches or pull requests

3 participants