4

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.

tezaurismosis
  • 53
  • 2
  • 10

1 Answers1

3

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.

Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
  • This bleeding edge stuff is cool, but sometimes painful. Thanks for the simple solution. It worked for me :) – joshmcode Apr 10 '16 at 14:06
  • Your answer was useful, thanks, but in the code version that I have now, after step 1. a list appears in which appears "c # for visual studio code powered by omnisharp" and clicking can be updated. Sorry for my bad english – Angel Angel Jan 07 '17 at 22:58