Instead of just touch coreApp.sln, create the sln file with dotnet and add the project to the solution:
dotnet new sln
dotnet sln add coreApp.csproj
Now you can get completion etc.
You didn't add the NuGet reference to your .csproj file in that example
dotnet new sln -o coreApp
cd coreApp
dotnet new console
dotnet sln add coreApp.csproj
dotnet add coreApp.csproj package "Newtonsoft.Json"
dotnet restore
vim Program.cs
Line 5 adds the Newtonsoft.Json reference, just as you manually added it to coreApp.csproj in your first example
Well then I'm stuck. I've tested those commands a couple of times now and it works fine for me with dotnet --version 2.1.101.
Could you try to create a valid program using Newtonsoft and see if it can build? Something like this:
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace coreApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(JObject.Parse("{'Hello':'world'}").ToString(Formatting.Indented));
}
}
}
Then do dotnet run and see if it works?
My dotnet version is 2.1.101 too.
OK! Looking to YCM third_party directory, I see that it's using OmniSharpServer and not this omnisharp-roslyn.
I'll need ask to YCM to support omnisharp-roslyn.
Since it's not a roslyn problem, do you want to close the issue @DavidUser?