❔ WPF System.ObjectDisposedException: 'Cannot access a closed Stream.'

I have a wpf application and when I navigate from Page A to page B then back to Page A, the xaml initializecomponent() throws the above error. The issue is.. I'm not using a stream reader/writer anywhere in this. Below is the call stack I feel like something somewhere is getting disposed and then I'm trying to use it but I'm not sure where to start to find this.
4 Replies
Becquerel
Becquerel2y ago
if you do a ctrl+shift+f in your solution for .Dispose() or using (, does anything show up? what kind of objects are on page A and B? anything like images, videos, audio files?
Bunnies4Breakfst
Bunnies4BreakfstOP2y ago
no dispose but a bunch of using, mainly to do with image cache. We have icons but i don't think they go through the cache none of the usings are on these pages or viewmodels no idea why this is happening but users shouldnt be able to navigate back to page A anyways.. might just disable it @Becquerel found it, when we were hitting page A the second time, a check was throwing us BACK to page B in the constructor of page A and the InitializeComponent() was throwing since the page has been disposed... god i hate our code Im moving the navigation to the page loaded which happens after the constructor/initializecomponent is complete
Becquerel
Becquerel2y ago
PepeHands sympathies
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server