Reputation: 93
I just created a simple project (discord bot) and generated the .sln
and .csproj
files via cmd... but when I start absolutely no IntelliSense, and I look at the logs that this is what it gives:
Starting OmniSharp server at 15/12/2020, 10:31:24 am Target: d:\Discord Bots\Glide-Bot\Glide-Bot.sln
[ERROR] Error: spawn cmd ENOENT
And here is the .csproj
and the .cs
file.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Glide_Bot_Main</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Discord.Net" Version="2.0.0" />
</ItemGroup>
</Project>
using System;
namespace Glide_Bot_Main
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
As you can see I haven't do anything except add the dependency of Discord.NET and it gives me no IntelliSense for the library or the standard library. I've been having this problem with unity projects as well... Any help is appreciated.
Upvotes: 0
Views: 318
Reputation: 76
Visual Studio has a nice GUI that you can use for resolving nuget dependencies. If you would like to use something besides Visual Studio, you could use VS Code. There are many extensions for managing nuget. Here are some options that I've seen:
I'm pretty sure this is the one I use: https://marketplace.visualstudio.com/items?itemName=jmrog.vscode-nuget-package-manager
This one also seems promising: https://marketplace.visualstudio.com/items?itemName=patcx.vscode-nuget-gallery
Edit:
Here are some docs on using nuget in Visual Studio: https://learn.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-in-visual-studio
Edit 2:
Further clarification. They couldn't get their intellisense because the nuget package wasn't installed. He could have ran a restore from the command line as well. Some of those GUIS can be helpful.
Upvotes: 1