Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Omnisharp server is not running Windows 10

I'm using VS Code to try out ASP.NET a little bit, but when I try to do: dnu restore it fails.

If I try to do it within VS Code I get a error message: Omnisharp server not running.

I don't really know what to do :( I'm running Windows 10 x64

like image 442
anned20 Avatar asked Feb 05 '16 16:02

anned20


People also ask

How do I restart Omnisharp?

There are times when OmniSharp does not start up at all, in which case you can run a command to restart it. In VS Code, you can use the Ctrl+Shift+P keybinding to enter commands. After using that keybinding, type in "restart omnisharp" and press enter.

What is Omnisharp server?

OmniSharp is a set of tooling, editor integrations and libraries that together create an ecosystem that allows you to have a great programming experience no matter what your editor and operating system of choice may be.

Does Visual Studio use Omnisharp?

C# for Visual Studio Code (powered by OmniSharp) This extension provides the following features inside VS Code: Lightweight development tools for . NET Core.

How do I run C sharp code in Visual Studio?

To do so, you can double-click or tap on the . csproj file in Windows File Explorer, or choose Open a project in Visual Studio, browse to find the . csproj file, and select the file.


2 Answers

Check the vs code Omnisharp log, Ctrl + Shift + U.

The Omnisharp server is not running error can result from a problem in your project.json causing issues with dnu restore. e.g. Issues resolving packages for one of the target frameworks?

It probably will not help but, you can try restarting Omnisharp : F1 "omni restart"

C# support is not bundled but it does sound like you have successfully installed it. Otherwise add C# with F1 "ext install", Enter, "C#"

You are right that there is little documentation

  • https://code.visualstudio.com/docs/languages/csharp - introduction to project types and omnisharp
  • https://docs.asp.net/en/latest/tutorials/your-first-mac-aspnet.html - yes OSX because windows instructions are for Visual Studio (page no longer available)
  • https://blogs.msdn.microsoft.com/visualstudioalm/2016/03/10/experimental-net-core-debugging-in-vs-code/ - expect better soon
like image 131
KCD Avatar answered Oct 01 '22 10:10

KCD


Visual Studio Code has Omnisharp built in. However, that doesn't mean you don't have to install ASP.NET 5 and DNX.

Follow the instructions found on this guide: https://code.visualstudio.com/Docs/runtimes/ASPnet5

Specifically, you'll want to follow these instructions: https://github.com/aspnet/home#upgrading-dnvm-or-running-without-visual-studio

Remember, Visual Studio is the heavyweight IDE that installs all that you need. Visual Studio Code is the lightweight node based editor that only has what you explicitly install/add to it. Thus, unlike Visual Studio, it does not automagically download ASP.NET 5 and DNX

like image 39
Tobiah Zarlez Avatar answered Oct 01 '22 10:10

Tobiah Zarlez