So, I'm building applications for Office (via VSTO's) with C# and WPF. I'm seeing that the WPF application (via memory profilers) is never collected after being launched.
I'm going as far as creating a new AppDomain for the WPF Application, launching it inside that AppDomain, and following the use, Unloading the AppDomain, but I still have objects around -- and my handles are still increasing in size.
Does anyone know of any strange behaviors of VSTO and WPF applications? My only guess is that for some reason, the WPF application is loaded on the UI thread shared by Office, so it never gets cleaned up...
Any thoughts on the increasing handles? I'm getting a lot of backlash from my client's deployment team that the "increasing handles are not acceptable."
EDIT:
Let me be clear -- the WPF applications are launched from the Ribbon, and they then produce output in the respective application, i.e. if in Excel, you'll enter information and it will then build a spreadsheet for you based on the information provided; if in PowerPoint, you'll enter information (in the WPF application launched from the ribbon) and it'll build a slide based on the information you provided.