Omnisharp does not start (Visual Studio)

Asked

Viewed 496 times

-4

OUTPUT of vscode:

Starting OmniSharp server at 24/06/2020 21:52:56
    Target: c:\Users\Wagner\Desktop\Nova pasta\Xistilishy\Xistilishy\Xistilishy.sln

OmniSharp server started.
    Path: c:\Users\Wagner\.vscode\extensions\ms-dotnettools.csharp-1.22.1\.omnisharp\1.35.1\OmniSharp.exe
    PID: 15848

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 16.4 - "c:\Users\Wagner\.vscode\extensions\ms-dotnettools.csharp-1.22.1\.omnisharp\1.35.1\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to 'c:\Users\Wagner\.vscode\extensions\ms-dotnettools.csharp-1.22.1\.omnisharp\1.35.1\.msbuild\Current\Bin\MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 16.4 - "c:\Users\Wagner\.vscode\extensions\ms-dotnettools.csharp-1.22.1\.omnisharp\1.35.1\.msbuild\Current\Bin"
            CscToolExe = csc.exe
            CscToolPath = c:\Users\Wagner\.vscode\extensions\ms-dotnettools.csharp-1.22.1\.omnisharp\1.35.1\.msbuild\Current\Bin\Roslyn
            MSBuildExtensionsPath = c:\Users\Wagner\.vscode\extensions\ms-dotnettools.csharp-1.22.1\.omnisharp\1.35.1\.msbuild
            MSBuildToolsPath = c:\Users\Wagner\.vscode\extensions\ms-dotnettools.csharp-1.22.1\.omnisharp\1.35.1\.msbuild\Current\Bin
System.InvalidCastException: Conversão especificada não é válida.
   em Roslyn.Utilities.EventMap.GetRegistries_NoLock[TEventHandler](String eventName)
   em Roslyn.Utilities.EventMap.AddEventHandler[TEventHandler](String eventName, TEventHandler eventHandler)
   em lambda_method(Closure , LifetimeContext , CompositionOperation )
   em System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   em System.Composition.Hosting.Providers.ImportMany.ImportManyExportDescriptorProvider.<>c__DisplayClass3_2`1.<GetImportManyDescriptor>b__4(ExportDescriptor e)
   em System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   em System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   em System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   em lambda_method(Closure , LifetimeContext , CompositionOperation )
   em System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   em System.Composition.Hosting.Providers.ImportMany.ImportManyExportDescriptorProvider.<>c__DisplayClass3_2`1.<GetImportManyDescriptor>b__4(ExportDescriptor e)
   em System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   em System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   em System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   em System.Composition.Hosting.Core.CompositionOperation.Run(LifetimeContext outermostLifetimeContext, CompositeActivator compositionRootActivator)
   em System.Composition.Hosting.Core.LifetimeContext.TryGetExport(CompositionContract contract, Object& export)
   em System.Composition.CompositionContext.GetExport(CompositionContract contract)
   em System.Composition.CompositionContext.GetExports(Type exportType, String contractName)
   em System.Composition.CompositionContext.GetExports[TExport](String contractName)
   em OmniSharp.Stdio.Host.Initialize() na D:\a\1\s\src\OmniSharp.Stdio\Host.cs:linha 57
   em OmniSharp.Stdio.Host..ctor(TextReader input, ISharedTextWriter writer, IOmniSharpEnvironment environment, IServiceProvider serviceProvider, CompositionHostBuilder compositionHostBuilder, ILoggerFactory loggerFactory, CancellationTokenSource cancellationTokenSource) na D:\a\1\s\src\OmniSharp.Stdio\Host.cs:linha 51
   em OmniSharp.Stdio.Driver.Program.<>c__DisplayClass0_1.<Main>b__1() na D:\a\1\s\src\OmniSharp.Stdio.Driver\Program.cs:linha 70
   em OmniSharp.HostHelpers.Start(Func`1 action) na D:\a\1\s\src\OmniSharp.Host\HostHelpers.cs:linha 29
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).

print do vscode

print da extensão CSharp

I was programming a game by Unity and the visual studio was normal, I turned off the pc and when I went to use again started the problem...

When I start Visual Studio it opens normally, but when starting C# the omnisharp does not start at all (responsible for the Intellisense/autocomplete) and the error in the console, I tried CTRL+SHIFT+P and Restart in omnisharp but the error in the console, I tried to open sln project but also did not change anything, I tried to create another project and nothing happened too, what should I do now? I tried to uninstall and install vscode and the C# extension but the error persists!.

1 answer

0


Your version may be outdated. Uninstall and reinstall the C# extension in vscode.

  1. Press F1, typhoon ext show installed, Press Enter. Click on C# and then on the button uninstall to remove.
  2. Restart the vscode.
  3. Press F1, type ext install, press Enter and search by C#. Click on the icon install to download.
  4. Restart the vscode.

Ominsharp will spin now.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.