madskristensen / MarkdownEditor

A Visual Studio extension
Other
409 stars 93 forks source link

ObjectDisposedException on git undo changes #182

Open janzii opened 5 years ago

janzii commented 5 years ago

Installed product versions

Description

Undoing git changes throws ObjectDisposedException

Steps to recreate

  1. Add a markdown file (in an asp.net non-core web application, if that matters)
  2. With the editor open, undo git changes
  3. Output from Markdown Editor shows an ObjectDisposedException was thrown.

Current behavior

2019-03-01 13:09:38: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'WebBrowser'.
   at System.Windows.Controls.WebBrowser.get_AxIWebBrowser2()
   at System.Windows.Controls.WebBrowser.DoNavigate(Uri source, Object& targetFrameName, Object& postData, Object& headers, Boolean ignoreEscaping)
   at System.Windows.Controls.WebBrowser.NavigateToStream(Stream stream)
   at System.Windows.Controls.WebBrowser.NavigateToString(String text)
   at MarkdownEditor.Browser.<>c__DisplayClass24_1.<UpdateBrowser>b__1() in C:\projects\markdowneditor\src\Margin\Browser.cs:line 276
   at Logger.LogOnError(Action callback) in C:\projects\markdowneditor\src\Helpers\Logger.cs:line 43

Expected behavior

Not getting an exception.

madskristensen commented 2 years ago

This is fixed in the new preview extension https://marketplace.visualstudio.com/items?itemName=MadsKristensen.MarkdownEditor2