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

Change disposed exceptions to use ObjectDisposedException.ThrowIf #43503

Closed
JamesNK opened this issue Aug 24, 2022 · 1 comment · Fixed by #45954
Closed

Change disposed exceptions to use ObjectDisposedException.ThrowIf #43503

JamesNK opened this issue Aug 24, 2022 · 1 comment · Fixed by #45954
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions clean-up This issue is internal clean-up and has no effect on public APIs or expected behaviors task

Comments

@JamesNK
Copy link
Member

JamesNK commented Aug 24, 2022

Similar to #43482

APIs are available to simplify throwing ObjectDisposedException:
https://github.com/dotnet/runtime/blob/a54a823ece1094dd05b7380614bd43566834a8f9/src/libraries/System.Private.CoreLib/src/System/ObjectDisposedException.cs#L49-L73

Consider updating code to use ObjectDisposedException.ThrowIf.

@javiercn javiercn added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates area-runtime area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels labels Aug 24, 2022
@adityamandaleeka adityamandaleeka added the clean-up This issue is internal clean-up and has no effect on public APIs or expected behaviors label Aug 24, 2022
@adityamandaleeka adityamandaleeka added this to the .NET 8 Planning milestone Aug 24, 2022
@danmoseley
Copy link
Member

We can use this analyzer dotnet/roslyn-analyzers#6293

@ghost ghost locked as resolved and limited conversation to collaborators Feb 9, 2023
@danmoseley danmoseley removed the area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Jul 7, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions clean-up This issue is internal clean-up and has no effect on public APIs or expected behaviors task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants