Closed JVimes closed 2 years ago
Same FileNotFoundException
for Microsoft.ApplicationInsights
happening for me on 17.1.0 Preview 1.0 as well.
(Thanks for this great extension btw!)
Thanks for the bug report and sorry for the inconvenience. I haven't been able to reproduce it myself and I'm also on 17.1.0 Preview 1.0 (Community edition)
I suspect it might be related to other installed extensions that are pre-empting the loading of Microsoft.ApplicationInsights. @bddckr would you mind listing what other extensions you have installed?
@pharring Sure, here you go!
{
"id": "a3f047ea-dcc3-473f-bb4f-8a9a27f5fa4c",
"name": "My Visual Studio extensions",
"description": "A collection of my Visual Studio extensions",
"version": "1.0",
"extensions": [
{
"name": "Add New File (64-bit)",
"vsixId": "d48e8f25-661b-4970-8b66-03f051ba5fc3"
},
{
"name": "CodeMaid VS2022",
"vsixId": "9079e73d-3fbb-4e07-8dab-f44fa5d8e8b5"
},
{
"name": "Editor Guidelines (Preview)",
"vsixId": "EditorGuidelines.f7dfa085-35e4-4844-8842-48298d5eaee0"
},
{
"name": "Extension Manager 2022",
"vsixId": "4a196712-2c3f-4730-ad1d-e7cda4185eb3"
},
{
"name": "F# Formatting",
"vsixId": "FantomasVs.4acfe0e3-4521-45ed-9c32-9265806f4108"
},
{
"name": "File Icons",
"vsixId": "3a7b4930-a5fb-46ec-a9b8-9610c8f953b8"
},
{
"name": "Fix Mixed Tabs 2022",
"vsixId": "FixMixedTabs2022.9f1d3050-b986-4b10-ae36-97c6efc5e968"
},
{
"name": "Markdown Editor (64-bit)",
"vsixId": "9ca64947-e9ca-4543-bfb8-6cce9be19fd7"
},
{
"name": "Match Margin 2022",
"vsixId": "MatchMargin2022.d85a25b5-f7b3-46a9-997e-a2d669dc2c93"
},
{
"name": "Open in Visual Studio Code",
"vsixId": "e99dde0e-e023-410d-bc5d-3f76db71e3f0"
},
{
"name": "Rewrap",
"vsixId": "Rewrap.stkb.4d01f0ab-ed41-47cc-a43f-777f84fcf51e"
},
{
"name": "Shrink Empty Lines 2022",
"vsixId": "SyntacticLineCompression2022.4452fb8f-b348-49eb-9499-76669d3f9c75"
},
{
"name": "SideScroller",
"vsixId": "SideScroller.Vsix.d0f12930-4bcc-455c-b681-f765aaab3d6f"
},
{
"name": "Subword Navigation",
"vsixId": "ad7396e5-bd21-4114-90e6-36d157cbcc84"
},
{
"name": "Time Stamp Margin 2022",
"vsixId": "TimeStampMargin2022.255e8b14-4a53-4eb7-89a7-7ab741c1f612"
},
{
"name": "Visual Studio Spell Checker (VS2022 and Later)",
"vsixId": "E1019027-EE37-4B1A-AD4C-25CAA92CA2D5"
},
{
"name": "VSColorOutput64",
"vsixId": "65dd734b-180a-4c67-b245-56de889637e1"
}
]
}
Thanks for looking into this.
@bddckr @JVimes thanks again for the report. I suspect the problem is with the "upgrade" from 17.0 preview to 17.1 preview. If anyone sees this on 17.0 Current (that's what they're calling the stable channel now), let me know.
I saw a slightly different problem myself in 17.1 Preview: The package loaded without error (right-click menu works), but the editor adornment did not load due to a MEF composition failure.
Please could you also try one troubleshooting step for me:
devenv /resetuserdata
After that, launch VS and try again. You'll need to sign into VS again. Re-install Editor Guidelines and see if it works. You may have to re-install all your other extensions manually (I'm not sure if "Roaming Settings" will automatically install them eventually).
Let me know whether it works or not.
Thank you @pharring. I still get the error message after devenv /resetuserdata
. I believe problem started for me, as you suspected, after updating from 17.0 Preview to 17.1 Preview.
Curious if it relates to that error message (above) in ActivityLog.xml:
LegacySitePackage failed for package [EditorGuidelinesPackage]
Source: 'EditorGuidelines' Description: Could not load file or assembly 'Microsoft.ApplicationInsights, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ApplicationInsights, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.ApplicationInsights, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at EditorGuidelines.EditorGuidelinesPackage.Initialize()
at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)
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].
Thanks. Yes, that FileNotFoundException is what I'm trying to understand. The file in question -- Microsoft.ApplicationInsights.dll -- is bundled with the Editor Guidelines package (VSIX). It's also included in Visual Studio itself.
One difference that seems relevant between 17.0 and 17.1 appears in devenv.exe.config:
<dependentAssembly>
<assemblyIdentity name="Microsoft.ApplicationInsights" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0"/>
<codeBase version="2.1.0.0" href="Extensions\Microsoft\AppInsights\Core\Microsoft.ApplicationInsights.dll" />
</dependentAssembly>
That's from 17.1. It refers to version of Microsoft.ApplicationInsights.dll in the "Extensions\Microsoft\AppInsights\Core" folder, but that folder isn't present on my machine. I installed the Community edition with minimal workloads. I assume it's a bug in authoring for 17.1 -- that codeBase entry shouldn't be there unless the relevant workload is also installed.
One workaround would be to hand-edit the devenv.exe.config file (need to run as administrator to edit it) and remove that whole dependentAssembly entry. Another would be to find which workload brings in that "Extensions\Microsoft\AppInsights\Core" folder. I'm looking into that.
Found it: "Developer Analytics tools" Launch the Visual Studio Installer, find the VS 2022 Preview channel and select "Modify" Then go to "Individual Components" and search for "Developer Analytics". Check the "Developer Analytics tools" check box and update your installation.
That should fix it. @JVimes @bddckr FYI. Please try the steps above and let me know if the issue is fixed.
That worked around the problem for me, thank you. Hopefully a fix isn't too hard.
The fix will have to come from the Visual Studio team in a 17.1 update. I've engaged VSIX support on an internal channel and I'll also file a feedback ticket.
Installing Developer Analytics tools to 17.1.0 Preview 1 worked to restore the extension's functionality for me as well, thank you!
Thanks for confirming.
Same issue is occurring on the released 17.1.0 with the same working-around still functional and necessary
Yes, I can confirm this is still happening in the 17.1 released to the stable channel.
As I see in the feedback ticket this is only going to be fixed in 17.2. Thanks for the extension! And the workaround, it works :)
I'm adding the stack trace here, so anyone searching for it can find this ticket and the workaround. Thanks!
A MEF Component threw an exception at runtime: Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "EditorGuidelines.ColumnGuideAdornmentFactory". ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ApplicationInsights, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. at EditorGuidelines.ColumnGuideAdornmentFactory.OnImportsSatisfied() --- End of inner exception stack trace --- at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.InvokeOnImportsSatisfied() at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.NotifyTransitiveImportsSatisfied() at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState) at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState) at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose() at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.
b__0()
Just wanted to say thank you @pharring for researching and posting a workaround. Made my day.
Hi Paul, following your musings on options to deal with absent/mislinked component in 17.1, I have tried the edit devenv.exe.config
route, and can confirm it as workable.
Two observations:
devenv.exe.config
at ^\Users\<Luser>\AppData\Local\Microsoft\VisualStudio\17.0*
should be deleted during the "surgery" as it may interfere with the modified core config contents (mine led to a VS crash and inability to re-start, and upon subsequent inspection, contained cut-off garbage). This file seems to get re-created at VS launch if missing, which lowers the deletion risk.<dependentAssembly>...</dependentAssembly>
should be indeed removed from the file. I have attempted to comment it out first, which made VS on re-launch very unhappy (& crash). The config XML parser must be very neurotic indeed.In general, I would like to thank you for ongoing support and excellent code. Kudos for convincing minders of the root cause to fix things - I'll await it on regular update channel. Cheers!
Another thought: a small temporary note (until mainstream VS is fixed) on your feature page (https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelinesPreview&ssr=false#overview) briefly cautioning hopeful users that there is a known issue with a workaround, would have actually pre-empted me from contacting you, as the solution is already covered in github. Just an idea. Cheers! - Sid
I can confirm that updating to VS 2022 v17.2.x fixes the above issue.
I can confirm that updating to VS 2022 v17.2.x fixes the above issue.
I'm using version 17.2.3 and still got the same error
and reopening the devenv caused this error
System.InvalidOperationException
The service 'Microsoft.VisualStudio.Shell.Interop.IVsTaskList' must be installed for this feature to work. Ensure that this service is available.
at Microsoft.VisualStudio.Shell.TaskProvider.get_VsTaskList()
at Microsoft.VisualStudio.Shell.TaskProvider.Refresh()
at Microsoft.VisualStudio.Shell.TaskProvider.ResumeRefresh()
at Microsoft.VisualStudio.Data.Tools.Package.UI.DataSchemaErrorTaskHelper.AddTasks(IList`1 tasks)
at Microsoft.VisualStudio.Data.Tools.Package.UI.DataSchemaErrorTaskService.ProcessErrorsInQueue(Boolean ignoreQueueStabilization)
at Microsoft.VisualStudio.Data.Tools.Package.IdleProcessingComponent.FDoIdle(UInt32 grfidlef)
I haven't seen that one before.
For sure, a missing IVsTaskList
service would be a problem for many packages, but I don't think EditorGuidelines uses it. I suspect you have a general problem with your installation and EditorGuidelines happened to be fingered as the culprit.
The call-stack indicates that it's coming from the data tools package (not editor guidelines). Was there another error/exception in the activity log with EditorGuidelines in the callstack?
Maybe this isn't supported yet, but when I try to set a guideline in Visual Studio 17.1.0 Preview 1.0, I get:
ActivityLog.xml shows: