Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gedri opened this issue Jul 7, 2021 · 6 comments
Open

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

gedri opened this issue Jul 7, 2021 · 6 comments
Labels

Comments

@gedri
Copy link

gedri commented Jul 7, 2021

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 gedri added the bug label Jul 7, 2021
@sharwell
Copy link
Collaborator

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
Copy link

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.

@ChuckM-Intel
Copy link

ChuckM-Intel commented Aug 13, 2021

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
Copy link

misterorlov commented Sep 6, 2021

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
Copy link

ChuckM2 commented Sep 8, 2021

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
Copy link
Author

gedri commented Sep 8, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants