none
Word Slow Shutdown on Windows 8 when Using WPF in Application AddIn RRS feed

  • Question

  • I'm in the process of building an application level add-in that is targeted to work with most of the Office suite of tools - primarily Word, Powerpoint and Excel.  I've added a ribbon tab to these tools and we employ the use of WPF (under a WinForm using compatibility) and the .Net 4.0 framework for our solution.  The symptom that I'm experiencing is that Word and Excel take a long time to quit on the Windows 8 platform.  The symptoms I'm experiencing are identical to those described here, but the environment sounds like it's different.  Whatever worked to solve that issue (which is unclear based on the posts/replies) hasn't worked in my environment.

    Here is what I am running:
      • Our add-in runs beautifully on Windows 7.0 (64 bit), Windows XP (32 bit) and Office 2010 (32 bit) SP1 - no issues in any office application
      • We are leveraging .Net 4.0 full framework and 32 bit office 2010
      • On Windows 8:
      1. If you launch the wizard that uses WPF and close it, then both Word and Excel experience a delay of up to 30 seconds when you attempt to close their application window
      2. The same sequence of operations within PowerPoint does not cause an equivalent delay
      3. The delay upon quit/exit for Word and Excel happens in both Office 2010 SP1 and Office 2013, both 32 bit
      4. The delay happens after all interaction with the Add-In has completed.  In particular, I've added a breakpoint to the ThisAddInShutdown method and confirmed that the delay happens after the method has returned
      5. I've attempted to force a GC within ThisAddInShutdown - to no effect, delay still occurs in Word, Excel.
      6. I've ensured that all my WPF UserControls were sent the Dispose() method
      7. I've seen nothing unusual in the Windows Event log

    I am at a complete loss on how to proceed on debugging this.  I've spent several hours reading blog posts and trying different things.  "Breaking" during debug in VS2012  as the shutdown delay is occurring provided no additional information.  I suspect that there is something going on in the COM interop layer interacting with the various office application object models, perhaps as a result of me missing a call or something that is not exposed under Windows 7 but is exposed under Windows 8.  I've validated that the .Net framework is the same in Windows 7 and Windows 8 (despite the .Net 4.5 in place upgrade).  I've tried turning on VS2012 break for a wider range of exceptions.

    I have a simple test solution (Visual Studio 2012 Update 2) that I can provide or post somewhere which clearly exhibits the behaviour.

    Thursday, March 28, 2013 3:30 PM

Answers

  • Thanks Forrest.  I have logged a Connect issue here: https://connect.microsoft.com/VisualStudio/feedback/details/783019/word-slow-shutdown-on-windows-8-when-using-wpf-in-application-addin#details
    Monday, April 8, 2013 1:53 PM

All replies

  • Sounds like this post for MS Project is also exhibiting the same symptom.
    Thursday, March 28, 2013 10:33 PM
  • Hi Dan,

    Thank you for posting in the MSDN Forum.

    I'll consult my colleague on your issue. You'll be informed if there's any update.

    Thank you for your patience and understanding.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 1, 2013 1:31 PM
    Moderator
  • Dan, can you upload the test solution that  exhibits the behavior? It will help people understand which situation are you in. Skydrive is ideal place for sharing. http://skydrive.com

    thanks.


    Forrest Guo | MSDN Community Support | Feedback to manager

    Tuesday, April 2, 2013 2:46 AM
    Moderator
  • Thanks for the quick responses!  I've uploaded the solution here: http://sdrv.ms/XorG3s.  Runs with either Office 2013 (32 bit) or Office 2010 Service Pack 1 (important) (32 bit).  Make sure one of those is installed.  Just load the solution into Visual Studio 2012 Update 2 and hit the Debug Start.  Project will display a separate tab on the ribbon. There will be 1 button on the ribbon that brings up a WPF User Control (within a Windows Form) - the user control has a single button on it to close the window.

    If you start the solution (and therefore Word) on a Windows 8 machine but don't invoke the WPF control, Word shuts down quickly when you close it.  If you bring up the WPF control, shutting down word can take anywhere from 15-40 seconds.

    On Windows 7, Word shuts down immediately in both cases. 

    Tuesday, April 2, 2013 8:32 PM
  • I have reproduced the issue. Would you create a report on connect web site, so product team will investigate and evaluate them? In my test, WPF is not the root cause, but ElementHost control is. Without the ElementHost, Word shutdown fast.

    http://connect.microsoft.com/visualstudio

    thanks.


    Forrest Guo | MSDN Community Support | Feedback to manager

    Wednesday, April 3, 2013 7:12 AM
    Moderator
  • Thanks Forrest.  I have logged a Connect issue here: https://connect.microsoft.com/VisualStudio/feedback/details/783019/word-slow-shutdown-on-windows-8-when-using-wpf-in-application-addin#details
    Monday, April 8, 2013 1:53 PM
  • Hi Dan,

    Thank you very much for your time and effort into this issue.

    Have a nice day.


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 9, 2013 9:51 AM
    Moderator
  • Hi

    I know is an old post. But I'm having the same issue on Excel and cannot find any fix for the issue.

    I've installed the new .NET Framework 4.7.2 and as well the new VSTO (10.0.60825) runtime

    https://www.microsoft.com/en-us/download/details.aspx?id=54251
    https://www.microsoft.com/net/download/dotnet-framework-runtime

    Very appreciated if anyone can help resolve this issue and we have about 50 users have this issue when closing Excel with the VSTO adding using the CustomTaskPane.

    Regards,
    David
    Thursday, May 3, 2018 4:38 AM