0

I've been following a tutorial to make a discord robot in .net framework and visual studio doesn't like "ServiceCollection" it says this

"Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name 'ServiceCollection' could not be found (are you missing a using directive or an assembly reference?) robot discord C:\Users\tren6\Desktop\Program.cs 24 Active"

I'm a begginer to coding and i would love some help

  • 1
    The editor is telling you that you are trying to use a type that it doesn't know about, and that it likely doesn't know about because either your project is not referencing an assembly (i.e. a DLL) that contains the class, or that your code file is missing a `using` directive that imports the class from the assembly (or both). It's also possibly you have typos or other issues in your code, but it's impossible for us to tell without seeing the code. – Preston Guillot Jul 20 '20 at 14:16
  • First check in VS Solution Explorer : Reference to see if the robot assistance is in the list of references. Then you need at top of module the Namespace of the Robot like "using System.Net;". – jdweng Jul 20 '20 at 14:17
  • First thing to check are the things the error message _specifically tells you to check_. If that does not turn out to help, there are many other reasons you might get that error. See duplicates. – Peter Duniho Jul 20 '20 at 16:05

0 Answers0