❔ 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
Becquerel15mo 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
Bunnies4Breakfst15mo 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
Becquerel15mo ago
PepeHands sympathies
Accord
Accord15mo 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
More Posts
❔ Returns the left pointer, why?https://leetcode.com/problems/first-bad-version/solutions/3403742/binary-search-solution-for-c-compl❔ Error passing builder.Configuration as argument - .net 7As you can see I am passing the builder.Configuration as an argument to my ConfigureIdentityServices❔ Where to store the app service app settings variable so I can access them based on environmentIn azure app service, currently I'm maintaining the application setting variable. In the local how t❔ Error CS0017Im doing a graded assignment and im working on it myself; Im stuck at this one line that is telling GIT Question for companySorry if this is a really noob question, but I don't want to bother my manager and also I've never w✅ Debugging razor component page isn`t workingCould you please tell me why the debugger on the .razor page may not work? On the page to which visu❔ How to read configuration based on environmentI have a stored my connection string as configuration in web.config. Now I have stored the same conn❔ PlayStation 2 startup recreationWondering how I can recreate the iconic PS2 startup, and whag framework would fit this question❔ Send using http post with multiple parameters, to an endpoint defined in C# with minimal APIsI've got an endpoint like so: ```csharp app.MapPost("/endpoint1", async ValueTask<IResult?> (string ❔ Does AssemblyLoadContext use dependencies that are already loaded in the default context?I'm not debugging any issues, I'm just trying to make sure I understand what I can expect this subsy