niklaskallander / vs-unobtrusive-code

An extension for Visual Studio that lets you hide away obtrusive code like comments and logging, to let you focus on the actual flow of your application.
MIT License
24 stars 1 forks source link

File not found exception #2

Closed goodeye closed 5 years ago

goodeye commented 5 years ago

I have VS Professional 2019, version 16.1.4. I installed this extension, restarted Visual Studio, and get this exception:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis.CSharp, Version=3.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.CodeAnalysis.CSharp, Version=3.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at UnobtrusiveCode.ObtrusiveCodeTagger.GetSpansFrom(ITextSnapshot snapshot, UnobtrusiveCodeOptions options) at UnobtrusiveCode.ObtrusiveCodeTagger.Parse(UnobtrusiveCodeOptions options) at UnobtrusiveCode.ObtrusiveCodeTagger..ctor(ITextBuffer buffer, IClassificationTypeRegistryService classificationService, IObtrusiveCodeSpanNormalizer normalizer, IEnumerable1 parsers) at UnobtrusiveCode.ObtrusiveCodeTaggerProvider.CreateTaggerFor(ITextBuffer buffer) at UnobtrusiveCode.ObtrusiveCodeTaggerProvider.<>c__DisplayClass6_01.b__0() at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func1 creator) at UnobtrusiveCode.ObtrusiveCodeTaggerProvider.CreateTagger[T](ITextBuffer buffer) at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator1.InstantiateBuferTagger(Lazy2 factory, ITextBuffer textBuffer, IList1 newTaggers) --- 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].

niklaskallander commented 5 years ago

@goodeye first off, thanks for reporting this! (:

At what point do you get that exception? At startup, when opening a file, when using the command (ALT+Q), or when ...?

I don't see why it wouldn't work. Do you have any other extensions installed? Not sure whether all extensions share the same app domain, which would force them to use the same version of dependencies. In which case an assembly binding redirect would perhaps solve this.

I'll have a look-see.

Thanks!

goodeye commented 5 years ago

This happens when loading the solution. When I open VS without a solution, it doesn't happen.

Yes, I have a few other extensions. If it comes to it, I can debug disabling them.

Bob

niklaskallander commented 5 years ago

@goodeye If you can spare the time, I'd really appreciate it if you could try finding out what other extension UnobtrusiveCode is conflicting with. Otherwise, would it be possible for you to list the other extensions you have installed?

Thanks!

niklaskallander commented 5 years ago

@goodeye I think I've solved this problem now. Found this: https://github.com/NuGet/Home/issues/5899, apparently nuget package references aren't automatically included in the built VSIX, it's been working for me because I'm on the latest version of Visual Studio, or so I gather.

Can you please update your version of Unobtrusive Code and see it it works for you as well?

Thanks (:

goodeye commented 5 years ago

This works, thank you! I downloaded it directly from your github - the marketplace didn't have it yet. It worked on VS 2019, for v16.1.4, then I updated to v16.3.1, and the extension also worked. I added it to this Stack Overflow question: https://stackoverflow.com/a/58120319/292060

niklaskallander commented 5 years ago

@goodeye awesome, thanks a bunch (: