Страницы

Поиск по вопросам

воскресенье, 5 января 2020 г.

Не работает IntelliSense для C# в VScode под GNU\Linux

#c_sharp #linux #visual_studio_code #mono #intellisense


Расширение установлено, проект создан через dotnet 2.2.102. Monodevelop также установлен.
Из логов OmniSharp понял, что он не может найти msbuilder. Нашёл, установил, но не
помогло. Два дня пытаюсь найти решение, нагугленные решения не помогают, ни установка
ранней версии плагина, ни переустановка VSC, ни установка MSBuilder.
Ошибки те же, IntelliSense не работает.
Вот логи от OmniSharp: 

System.TypeLoadException: Could not load type of field 'OmniSharp.MSBuild.ProjectManager:_queue'
(9) due to: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=4.5.24.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
  at (wrapper managed-to-native) System.RuntimeTypeHandle.is_subclass_of(intptr,intptr)
  at System.RuntimeTypeHandle.IsSubclassOf (System.RuntimeType childType, System.RuntimeType
baseType) [0x00016] in :0 
  at System.RuntimeType.IsSubclassOf (System.Type type) [0x00020] in :0 
  at System.RuntimeType.IsValueTypeImpl () [0x00026] in :0 
  at System.Type.get_IsValueType () [0x00000] in :0 
  at System.Type.get_IsClass () [0x0000b] in :0 
  at System.Composition.TypedParts.Discovery.TypeInspector.InspectTypeForPart (System.Reflection.TypeInfo
type, System.Composition.TypedParts.Discovery.DiscoveredPart& part) [0x0000b] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor (System.Collections.Generic.IEnumerable`1[T]
types, System.Composition.Convention.AttributedModelProvider attributeContext) [0x00037]
in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.Hosting.ContainerConfiguration.CreateContainer () [0x00042]
in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at OmniSharp.CompositionHostBuilder.Build () [0x00191] in :0 
  at OmniSharp.Stdio.Host..ctor (System.IO.TextReader input, OmniSharp.Stdio.Services.ISharedTextWriter
writer, OmniSharp.IOmniSharpEnvironment environment, Microsoft.Extensions.Configuration.IConfiguration
configuration, System.IServiceProvider serviceProvider, OmniSharp.CompositionHostBuilder
compositionHostBuilder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory,
System.Threading.CancellationTokenSource cancellationTokenSource) [0x0007e] in :0 
  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.
b__1 () [0x00116] in <93ea459c1f92407098a355199aa33d94>:0 at OmniSharp.CommandLineApplication+<>c__DisplayClass11_0.b__0 () [0x0000b] in :0 at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute (System.String[] args) [0x0035b] in :0 at OmniSharp.CommandLineApplication.Execute (System.Collections.Generic.IEnumerable`1[T] args) [0x00042] in :0 at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_1.
b__0 () [0x00028] in <93ea459c1f92407098a355199aa33d94>:0 at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in :0


Ответы

Ответ 1



Нашёлся ответ. Мне подсказали, что в настройках VSC (File->Preferences->Settings) есть пункт Omnisharp Use Global Mono, нужно выставить значение "never", после чего перезапустить среду. Всё работает.

Комментариев нет:

Отправить комментарий