Resharper Ultimate: 2016.3.2 DotMemory: 2016.3.2 Visual studio 2017 Windows 7 Prism 6.3.0 Ninject
This is a bit of a strange one, so I'm not sure exactly how to describe it, but i'll give it a shot.
Originally, I had pages set up to register with their regions, so all my pages were declared as follows
_kernel.Bind<IPageView, PageView>().To<PageView>();
followed by binding them to the region.
_regionManager.RegisterViewWithRegion(RegionNames.ContentRegion, typeof(PageView));
While updating things, I decided rather than having the hassle of binding the pages, and registering them with the region, I'd switch to using RequestNavigate, so I removed registering the view with the region, and changed the binding to
_kernel.RegisterTypeForNavigation<PageView>( PageNames.MyPage);
In debug mode this all worked perfectly fine. However this is where things get odd. I ran dotmemory to do some leak testing and found that if I took a snapshot before entering certain pages, the software would crash. If i didn't take a snapshot, or I took a snapshot after entering the page, nothing crashes.
Additionally, if I add
_kernel.get<PageView>();
after binding the page, I also have no issues. (so right now this is my terrible temp fix)
I'm just wondering if anyone has any idea why this might be happening. The only two conclusions I've come up with are either
a) RequestNavigate isn't resolving through ninject correctly. b) Somehow getting the snapshot from dotmemory is clearing anything that hasn't already been resolved from the kernel.
I'm not expecting much, but if anyone has any ideas what may be causing this it'd help a fair bit.