Atrejoe / MarkdownPreview

A Windows Preview handler for Markdown files
MIT License
121 stars 9 forks source link

Stopped working, "does not appear to be a valid file extension class" #11

Closed thjungers closed 5 years ago

thjungers commented 5 years ago

Hi,

I've installed MarkdownPreview and it worked fine for a few days. Then it stopped working (the preview pane shows "No preview available"). I've uninstalled and reinstalled MarkdownPreview, it doesn't change anything.

I've tried simple debugging with SharpShell's ServerManager. MarkdownPreview shows as installed and registered (x64 only, but when I install and register it for x86 it doesn't work either). When I start the shell from ServerManager, an error message appears: "an unhandled exception happened" with the error message

'' does not appear to be a valid file extension class.

Here is the full error message (sorry, the beginning is in French).

Consultez la fin de ce message pour plus de détails sur l'appel du débogage
juste-à-temps (JIT) à la place de cette boîte de dialogue.

************** Texte de l'exception **************
System.InvalidOperationException: '' does not appear to be a valid file extension class.
   à SharpShell.ServerRegistration.FileExtensionClass.Get(IRegistryKey classesKey, String fileExtension, Boolean createIfMissing) dans C:\projects\sharpshell\SharpShell\SharpShell\ServerRegistration\FileExtensionClass.cs:ligne 29
   à ServerManager.TestShell.TestShellForm.IsServerAssociatedWithShellItem(ISharpShellServer server, ShellItem shellItem) dans C:\projects\sharpshell\SharpShell\Tools\ServerManager\TestShell\TestShellForm.cs:ligne 427
   à ServerManager.TestShell.TestShellForm.shellListView_OnShellItemAdded(Object sender, ListViewItemEventArgs args) dans C:\projects\sharpshell\SharpShell\Tools\ServerManager\TestShell\TestShellForm.cs:ligne 70
   à Apex.WinForms.Controls.ShellListView.FireOnShellItemAdded(ListViewItem itemAdded)
   à Apex.WinForms.Controls.ShellListView.Initialise(ShellItem parentFolder)
   à Apex.WinForms.Controls.ShellListView.shellTreeView_AfterSelect(Object sender, TreeViewEventArgs e)
   à System.Windows.Forms.TreeViewEventHandler.Invoke(Object sender, TreeViewEventArgs e)
   à System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)
   à System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv)
   à System.Windows.Forms.TreeView.WmNotify(Message& m)
   à System.Windows.Forms.TreeView.WndProc(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Assemblys chargés **************
mscorlib
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3416.0 built by: NET472REL1LAST_B
    CodeBase : file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
ServerManager
    Version de l'assembly : 2.7.1.0
    Version Win32 : 2.7.1.0
    CodeBase : file:///C:/Users/Thomas/Downloads/sharpshell/ServerManager.exe
----------------------------------------
System.Windows.Forms
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3324.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3416.0 built by: NET472REL1LAST_B
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
SharpShell
    Version de l'assembly : 2.7.1.0
    Version Win32 : 2.7.1.0
    CodeBase : file:///C:/Users/Thomas/Downloads/sharpshell/SharpShell.DLL
----------------------------------------
System.Configuration
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3324.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3429.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.GeneratedCode
    Version de l'assembly : 1.0.0.0
    Version Win32 : 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.ComponentModel.Composition
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3190.0
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------
MarkdownPreview
    Version de l'assembly : 0.7.0.0
    Version Win32 : 0.7.0.0
    CodeBase : file:///C:/Users/Thomas/Downloads/MdPreview/MarkdownPreview.dll
----------------------------------------
MarkdownPreview.Core
    Version de l'assembly : 0.7.0.0
    Version Win32 : 0.7.0.0
    CodeBase : file:///C:/Users/Thomas/Downloads/MdPreview/MarkdownPreview.Core.dll
----------------------------------------
Apex.WinForms
    Version de l'assembly : 1.6.0.0
    Version Win32 : 1.6.0.0
    CodeBase : file:///C:/Users/Thomas/Downloads/sharpshell/Apex.WinForms.DLL
----------------------------------------
System.Windows.Forms.resources
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
System.Drawing.Design
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing.Design/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.Design.dll
----------------------------------------
System.resources
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/System.resources.dll
----------------------------------------
mscorlib.resources
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.Drawing.resources
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing.resources/v4.0_4.0.0.0_fr_b03f5f7f11d50a3a/System.Drawing.resources.dll
----------------------------------------

************** Débogage JIT **************
Pour activer le débogage juste-à-temps (JIT), le fichier de configuration pour cette
application ou cet ordinateur (machine.config) doit avoir la valeur
jitDebugging définie dans la section system.windows.forms.
L'application doit également être compilée avec le débogage
activé.

Par exemple :

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Lorsque le débogage juste-à-temps est activé, les exceptions non gérées
seront envoyées au débogueur JIT inscrit sur l'ordinateur
plutôt que d'être gérées par cette boîte de dialogue.

Any idea what could cause this?

Thanks. Thomas

Atrejoe commented 5 years ago

Hi @thjungers ,

This appears to be a Sharpshell thing (dwmkerr/sharpshell). It also seems possibly unrelated to your actual problem, but an issue with the server registration manager.

There is also a section on debugging Sharpshell in the Sharpshell page, see https://github.com/dwmkerr/sharpshell/wiki/Debugging-&-Diagnostics. Unfortunately I also experience issues, for some time it works, but on some machines it doesn't work at all, or intermittently.

Regards,

Robert

Atrejoe commented 5 years ago

...also, for some reasons, often I have to wait quite long, think minutes, before anything shows in my preview pane, after installation of a SharpShell server. This includes previews of other extensions, like things native to Windows, like images. Also when switching directories I may have to wait a long time.

After the first view, the previews have normal speed. Please note that you need to restart the explorer after installation.

I think maybe my registry for preview extension has been polluted.

Atrejoe commented 5 years ago

Minutes after opening this folder: image

Atrejoe commented 5 years ago

I added a bit of logging in the debugging branch, this may help you, it hasn't helped me very much :(.

Do you compile yourself, or are you using the binaries from the releases? In the last case I can supply the latest build.

Atrejoe commented 5 years ago

Reported problem is a SharpShell issue. Reason @thjungers started debugging is likely related to: #10