Extension fails to load with error System.IO.FileNotFoundException
See original GitHub issueStarted 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 '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].
</description>
</entry>
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:6
Top Results From Across the Web
System.IO.FileNotFoundException: 'Could not load file or ...
I have an application in .net core. the application was running fine, but the error started coming after I installed.
Read more >Visual Studio installer / extension install can't run (errors)
Can't install any Visual Studio extensions, I seem to get the same error for any extension I try to install or update. Could...
Read more >Debugging System.IO.FileNotFoundException - Cause and fix
The typical cause of this error is that the referenced assembly isn't on the file system. There can be multiple causes of this....
Read more >Load Error with extension - Developer Community
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.ExtensionManager, Version=15.0.0.0, Culture=neutral, ...
Read more >An unhandled exception of type 'System.IO. ...
I'm getting this error message when hitting F5 to debug projects: “An unhandled exception of type 'System.IO.FileNotFoundException' occurred ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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)
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 😉