laurentkempe / GitDiffMargin

Git Diff Margin displays live Git changes of the currently edited file on Visual Studio margin and scroll bar. Supports Visual Studio 2012 through Visual Studio 2022
https://marketplace.visualstudio.com/items?itemName=LaurentKempe.GitDiffMargin
MIT License
290 stars 39 forks source link

Extension fails to load with error System.IO.FileNotFoundException #425

Open gedri opened 3 years ago

gedri commented 3 years ago

Started recently - not sure whether it started as result of extension upgrade or something else but it was working for me until recently.

getting the same problem after I tried to uninstall re-install the extension.

Versions

What happened

Few seconds after VS loads with a solution, error bar appears with this message and the extension is not working: An exception of type FileNotFoundException has been encountered. This may be caused by an extension. Open log file

Looking at the log, I find this:

<entry>
    <record>2614</record>
    <time>2021/07/07 15:38:30.382</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>System.IO.FileNotFoundException: Could not load file or assembly &apos;GitDiffMargin.Impl, Version=3.11.0.0, Culture=neutral, PublicKeyToken=72dfb55bb9fc8a25&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;File name: &apos;GitDiffMargin.Impl, Version=3.11.0.0, Culture=neutral, PublicKeyToken=72dfb55bb9fc8a25&apos;&#x000D;&#x000A;   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)&#x000D;&#x000A;   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)&#x000D;&#x000A;   at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark)&#x000D;&#x000A;   at System.Type.GetType(String typeName, Boolean throwOnError)&#x000D;&#x000A;   at Microsoft.VisualStudio.Editor.Implementation.CommandHandlerServiceAdapter.&lt;&gt;c__DisplayClass34_0.&lt;FindCustomArgsType&gt;b__0()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint[T](Object errorSource, Func`1 call, T valueOnThrow)&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)&#x000D;&#x000A;&#x000D;&#x000A;WRN: Assembly binding logging is turned OFF.&#x000D;&#x000A;To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.&#x000D;&#x000A;Note: There is some performance penalty associated with assembly bind failure logging.&#x000D;&#x000A;To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].&#x000D;&#x000A;</description>
  </entry>
sharwell commented 3 years ago

Here's the formatted message:

System.IO.FileNotFoundException: Could not load file or assembly 'GitDiffMargin.Impl, Version=3.11.0.0, Culture=neutral, PublicKeyToken=72dfb55bb9fc8a25' or one of its dependencies. The system cannot find the file specified.
File name: 'GitDiffMargin.Impl, Version=3.11.0.0, Culture=neutral, PublicKeyToken=72dfb55bb9fc8a25'
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at Microsoft.VisualStudio.Editor.Implementation.CommandHandlerServiceAdapter.<>c__DisplayClass34_0.<FindCustomArgsType>b__0()
   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint[T](Object errorSource, Func`1 call, T valueOnThrow)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
MartinL0815 commented 3 years ago

Hi, since some weeks I have the same issue with the FileNotFound exception. While the margin still works, the hotkeys are disabled after the exception was raised.

My system is a bit different in the versions:

The formatted exception text seem to be the same, so I don't provide it here.

ChuckM-Intel commented 3 years ago

I'm having the same problem after upgrading Visual Studio 2019 to 16.9.3. Hotkeys no longer work.

System.IO.FileNotFoundException: Could not load file or assembly 'GitDiffMargin.Impl, Version=3.12.0.0, Culture=neutral, PublicKeyToken=72dfb55bb9fc8a25' or one of its dependencies. The system cannot find the file specified. File name: 'GitDiffMargin.Impl, Version=3.12.0.0, Culture=neutral, PublicKeyToken=72dfb55bb9fc8a25' at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) at System.Type.GetType(String typeName, Boolean throwOnError) at Microsoft.VisualStudio.Editor.Implementation.CommandHandlerServiceAdapter.<>c__DisplayClass34_0.<FindCustomArgsType>b__0() at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint[T](Object errorSource, Func`1 call, T valueOnThrow) --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

misterorlov commented 3 years ago

After many months of suffering, I realized that I could manually install the previous version. v3.10.2 works well now! (It's a bit tricky to make the studio to not update the extension right away. If it is updated, then you need to uncheck the "Automatically update" checkbox, then uninstall and install again from the .vsix file, then start VS and quickly uncheck the "Automatically update" checkbox and close VS)

ChuckM2 commented 3 years ago

I can confirm that old version v3.10.4 of GitDiffMargin works with Visual Studio 2019 ver 16.9.3, but GitDiffMargin version 3.12 does not work.

gedri commented 3 years ago

Thanks @misterorlov & @ChuckM2 - that really helped me. Just noticed that strangely, after installing 3.10.4, it shows in the Manage Extensions as 3.9.0.770, but the 'Release Notes' link goes to the 3.10.4 page... Anyway, it now works correctly, so doesn't matter what version it thinks it is ;-)