title: VSTO Add-in causing Word to crash on application close
body: <p>I have created numerous VSTO Add-Ins over the last few years. They are running against many versions of MS Word (but mostly MS Word 2016). I share a common library of code that I add to when working on each new project.</p>
  
  <p>I've noticed sporadic crashing when closing Word. It's the bad crash that requires task manager to clean up:</p>
  
  <blockquote>
    <p>"Microsoft Word has stopped working" "Close the program?"</p>
  </blockquote>
  
  <p>It happens very rarely. Rare enough that I shrug it off as "Crazy MS Word..".</p>
  
  <p>My colleagues have also noticed the problem a number of times. Often it went away after I built them a new assembly (with little or no code changes..)</p>
  
  <p>The situation is now more serious, seeing as a client has report the issue while testing. Interestingly, on the client machine the crashing is reproducible.</p>
  
  <p>I've spent the last few days commenting out code in an attempt to identify the problem. I thought I had the problem isolated to some Ribbon Visibility code, however it turns out I was just going round in circles..</p>
  
  <p>I've tried getting a crash dump via:</p>
  
  <pre><code>adsplus.exe -crash -pn winword.exe -o c:\Temp
  </code></pre>
  
  <p>After running this command I am unable to reproduce the error.</p>
  
  <p>I noticed that changing my log4net tracing level from WARN to DEBUG caused the reproducible error to stop. I'm not confident that it's fixed however.</p>
  
  <p>Is it a timing issue? Any idea how I can find the cause of my problem?</p>
  
  <p>-- Edit --</p>
  
  <p>@Thomas Weller, I was able to get a crash dump using <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/procdump" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/sysinternals/downloads/procdump</a>
  Will see how I go interpreting it.</p>