GitDiffMargin icon indicating copy to clipboard operation
GitDiffMargin copied to clipboard

Extension fails to load with error System.IO.FileNotFoundException

Open gedri opened this issue 3 years ago • 6 comments

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

  • Git Diff Margin version: 3.11.5
  • Visual Studio version: Microsoft Visual Studio Professional 2019 Version 16.9.2

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>

gedri avatar Jul 07 '21 15:07 gedri

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].

sharwell avatar Jul 23 '21 17:07 sharwell

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:

  • Visual Studio 2019 16.9.3
  • GitDiff Margin 3.12.1

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

MartinL0815 avatar Aug 13 '21 11:08 MartinL0815

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].

ChuckM-Intel avatar Aug 13 '21 21:08 ChuckM-Intel

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)

misterorlov avatar Sep 06 '21 20:09 misterorlov

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.

ChuckM2 avatar Sep 08 '21 02:09 ChuckM2

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 ;-)

gedri avatar Sep 08 '21 08:09 gedri