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

.NET 7: Code for New Results.Stream() overloads #26355

Closed
Tracked by #26326
Rick-Anderson opened this issue Jul 7, 2022 · 2 comments · Fixed by #26408
Closed
Tracked by #26326

.NET 7: Code for New Results.Stream() overloads #26355

Rick-Anderson opened this issue Jul 7, 2022 · 2 comments · Fixed by #26408
Labels
code help wanted Sample code help wanted.

Comments

@Rick-Anderson
Copy link
Contributor

Rick-Anderson commented Jul 7, 2022

The sample at New Results.Stream() overloads throws ObjectDisposedException: Cannot access a disposed object. Object name: 'Image1'.because ofusingin the following line using var image = await Image.LoadAsync("puppy.jpeg");`

Removing using and code seems to work. See this GitHub sample that reproduces the error

The blog is for Preview 3, I'm using 7.0.100-preview.5.22307.18.

@halter73 please advise

@halter73
Copy link
Member

halter73 commented Jul 8, 2022

If you move all the logic into the Results.Stream callback including the using var image, it should work.

@Rick-Anderson
Copy link
Contributor Author

@fiyazbinhasan add code to this folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code help wanted Sample code help wanted.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants