Closed peerem closed 3 years ago
In the solution folder under the .vs folder there is a CodeNav.json where settings are stored.
You could try deleting that.
Unfortunately this did not work. Even if Visual Studio loads with no code, CodeNav is not visible.
This maybe: https://www.google.com/amp/s/jessehouwing.net/visual-studio-uninstall-extension-from-the-commandline/amp/
The CodeNav id is "CodeNav.Samir Boulema.19687465-dc94-413d-ad72-6141e90c94d4"
I uninstalled and installed CodeNav several times - no improvement. I have now also tested this type of manual deinstallation, rebooted and then reinstalled - CodeNav is still not visible.
What is your Visual Studio version and what is the CodeNav version?
I'll try to see if I can reproduce it on my machine.
Thank you very much for the offer, but I don't think it can be reproduced. I use the extension on Visual Studio 16.9.6, in the company with the "Professional Edition" and for private projects with the "Community Edition". The problem affects the "Community Edition" and occurred after uninstalling another extension. Unfortunately I don't know which one anymore. In the meantime have re-imported the settings, which I regularly backup, many years of experience :), and made the window visible again.
<entry>
<record>217</record>
<time>2021/06/25 19:04:32.135</time>
<type>Error</type>
<source>Microsoft.VisualStudio.ComponentModelHost.VsShellComponentModelHost</source>
<description>Still unable to load MEF component DLL: Die Datei oder Assembly "Microsoft.CodeAnalysis, Version=3.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.</description>
<path>C:\USERS\USERNAME\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\16.0_4250209F\EXTENSIONS\KNKSLGMQ.KFL\CodeNav.dll</path>
</entry>
<entry>
<record>1383</record>
<time>2021/06/25 19:05:28.332</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [CodeNavToolWindowPackage]Source: 'CodeNav' Description: Could not load file or assembly 'Microsoft.VisualStudio.Threading, Version=16.10.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Das System kann die angegebene Datei nicht finden.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Threading, Version=16.10.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Das System kann die angegebene Datei nicht finden.
File name: 'Microsoft.VisualStudio.Threading, Version=16.10.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
 at CodeNav.ToolWindow.CodeNavToolWindowPackage.InitializeAsync(CancellationToken cancellationToken, IProgress`1 progress)
 at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass20_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)
 at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)
 at Microsoft.VisualStudio.Services.VsTask.GetResult()

WRN: Protokollierung der Assemblybindung ist AUS.
Sie können die Protokollierung der Assemblybindungsfehler aktivieren, indem Sie den Registrierungswert [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) auf 1 festlegen.
Hinweis: Die Protokollierung der Assemblybindungsfehler führt zu einer gewissen Leistungseinbuße.
Sie können dieses Feature deaktivieren, indem Sie den Registrierungswert [HKLM\Software\Microsoft\Fusion!EnableLog] entfernen.
</description>
<guid>{5C1C8131-1371-4401-8A3E-70E47C8AC0EC}</guid>
<hr>80070002</hr>
<errorinfo></errorinfo>
</entry>
An exception was encountered while constructing the content of this frame. This information is also logged in "C:\Users\Username\AppData\Roaming\Microsoft\VisualStudio\16.0_4250209f\ActivityLog.xml".
Exception details: System.IO.FileNotFoundException: Das System kann die angegebene Datei nicht finden. (Exception from HRESULT: 0x80070002) at Microsoft.VisualStudio.Shell.Interop.IVsShell5.LoadPackageWithContext(Guid& packageGuid, Int32 reason, Guid& context) at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage() at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()
Nice! Good to hear it's resolved and the stack trace is certainly helpful. Will look into preventing this from happening.
Hi! Same here... The CodeNav Window und Menu entries are invisibile. But Activity.log is empty... Reinstall didn't helped.
edit: Activity.log is NOT empty (i forgot to log...). It contains the same exception as mentioned above:
<entry>
<record>217</record>
<time>2021/07/01 11:04:17.926</time>
<type>Error</type>
<source>Microsoft.VisualStudio.ComponentModelHost.VsShellComponentModelHost</source>
<description>Still unable to load MEF component DLL: Die Datei oder Assembly "Microsoft.VisualStudio.Text.UI.Wpf, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.</description>
<path>C:\USERS\*****\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\15.0_CBB292E5\EXTENSIONS\TIV3IPXZ.AYL\CodeNav.dll</path>
</entry>
edit 2: I think i found the problem. CodeNav is searching for Microsoft.VisualStudio.Text.UI.Wpf in version 16.0.0.0. But the newest version i have, is 15.0.0.0... Do you changed the needed version recently?
New build is going up at the moment (8.0.407) with updated nuget packages. With the release of VS2022 I updated all packages and was targetting the wrong SDK version.
Hopefully that will solve the problem :)
Hi! Thanks for your fast response! I updated the CodeNav. No success... I tried a clean reinstall. No success...
There is still a version-problem. :(
Here is the new Log:
<entry>
<record>215</record>
<time>2021/07/02 08:20:39.505</time>
<type>Error</type>
<source>Microsoft.VisualStudio.ComponentModelHost.VsShellComponentModelHost</source>
<description>Still unable to load MEF component DLL: Die Datei oder Assembly "Microsoft.VisualStudio.CoreUtility, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.</description>
<path>C:\USERS\*****\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\15.0_CBB292E5\EXTENSIONS\JPORK4CQ.R24\CodeNav.dll</path>
</entry>
<entry>
<record>663</record>
<time>2021/07/02 08:20:41.297</time>
<type>Error</type>
<source>Microsoft.VisualStudio.IDE.ToolboxControlsInstaller.ToolboxInstallerPackage</source>
<description>Exception parsing Advertised (under HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework) as a version</description>
</entry>
...
<entry>
<record>766</record>
<time>2021/07/02 08:20:41.307</time>
<type>Error</type>
<source>Microsoft.VisualStudio.IDE.ToolboxControlsInstaller.ToolboxInstallerPackage</source>
<description>Exception parsing Windows Presentation Foundation (under HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework) as a version</description>
</entry>
663 until 766 in a row... Stuff like this: -Exception parsing NGenQueue (under HKEY_LOCAL_MACHINE\Software\Microsoft.NETFramework) as a version -Exception parsing policy (under HKEY_LOCAL_MACHINE\Software\Microsoft.NETFramework) as a version -Exception parsing Security (under HKEY_LOCAL_MACHINE\Software\Microsoft.NETFramework) as a version -Exception parsing Windows Presentation Foundation (under HKEY_LOCAL_MACHINE\Software\Microsoft.NETFramework) as a version -Exception parsing Advertised (under HKEY_LOCAL_MACHINE\Software\Microsoft.NETFramework) as a version -Exception parsing AssemblyFolders (under HKEY_LOCAL_MACHINE\Software\Microsoft.NETFramework) as a version -Exception parsing Fusion (under HKEY_LOCAL_MACHINE\Software\Microsoft.NETFramework) as a version -Exception parsing NGen (under HKEY_LOCAL_MACHINE\Software\Microsoft.NETFramework) as a version
Maybe try clearing the MEF cache? https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ClearMEFComponentCache
New version of CodeNav will be released shortly after some private testing... that might also fix it. We will get to the bottom of this 💪
Edit: Nope clearing MEF cache will not work, I think I found the problem...
I cleaned MEF cache with the posted tool. First of many MEF Exceptions shown in the posted tool:
Microsoft.VisualStudio.Composition.PartDiscoveryException: Fehler beim Überprüfen von Typ "CodeNav.CodeNavLeftFactory". ---> System.IO.FileNotFoundException: Die Datei oder Assembly "Microsoft.VisualStudio.CoreUtility, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
bei System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr typeInstArgs, Int32 typeInstCount, IntPtr methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
bei System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
bei System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
bei System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
bei System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
bei System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
bei System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
bei Microsoft.VisualStudio.Composition.AttributeServices.GetAttributes[T](ICustomAttributeProvider attributeProvider)
bei Microsoft.VisualStudio.Composition.AttributedPartDiscoveryV1.CreatePart(Type partType, Boolean typeExplicitlyRequested)
bei Microsoft.VisualStudio.Composition.PartDiscovery.CombinedPartDiscovery.CreatePart(Type partType, Boolean typeExplicitlyRequested)
bei Microsoft.VisualStudio.Composition.PartDiscovery.<>c__DisplayClass29_0.
Try the new release 🚀
Be sure to get the correct version, I had to split the extension in a VS2022 version and a VS2019/VS2017 version
Hi! Yes great, it works! Many Thanks!
How do you plan the support for the two versions? VS2017 / 19 only bug fixing? And how long?
Great to hear it is fixed 😄
The two versions have a shared code base, so any new features or fixes will be applied to both versions. The plan is to equally support both versions at least until VS2025? is released...
After uninstalling another extension, the CodeNav window shows exceptions. After restarting Visual Studio, CodeNav was invisible. It is not visible under "other windows" or in the editor.
Where are the settings saved so I can reset CodeNav? Even multiple reinstallations did not bring success.