Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OmniSharp failed to start in Visual Studio Code

I open folder with existing MSBuild project (actually from VS 2012) on C# in VSCode (v. 0.10.3) under Kubuntu 15.04. OmniSharp throw error after start:

[INFO] Starting OmniSharp at '/home/tezaurismosis/Development/NET/ConsoleApp/ConsoleApp.sln'...
[INFO] Started OmniSharp from '/home/tezaurismosis/VSCode/resources/app/extensions/csharp-o/bin/omnisharp' with process id 14956...
System.InvalidOperationException: Failed to resolve the following dependencies for target framework 'DNX,Version=v4.5.1':
    framework/System.Collections 
    framework/System.Collections.Concurrent 
    framework/System.Globalization 
    framework/System.IO 
    framework/System.Net.Http.WebRequest 
    framework/System.Reflection 
    framework/System.Runtime 
    framework/System.Text.Encoding 
    framework/System.Threading.Tasks 
Searched Locations:
... some paths ...
Try running 'dnu restore'.
at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) <0xb71f6a58 + 0x0035b> in <filename unknown>:0 
[ERROR] Error: Failed to start OmniSharp

I have installed latest version of Mono (4.2.1) and all subpackages with Mono assemblies, install dnvm and run dnvm upgrade -r mono, run dnu restore, but OmniSharp failed again and again and IntelliSence did'nt work in VSCode.

How can I fix it?

P.S. It's not ASP.NET, just console C# project.

like image 864
tezaurismosis Avatar asked Oct 28 '25 10:10

tezaurismosis


1 Answers

Your versions might be out of date. Uninstall and reinstall the C# extension in vs code.

  1. Press F1, type ext show installed, press Enter. Click the x to remove it.
  2. Restart vscode.
  3. Press F1, type ext install, press Enter. Click the download icon to install.
  4. Restart vscode.

Ominsharp will now run.

like image 166
Shaun Luttin Avatar answered Oct 29 '25 23:10

Shaun Luttin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!