Error Message:
The type or namespace name 'List<>' could not be
found (are you missing a using directive or an assembly reference?)
Error Description:
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
List<int> objList = new List<int>();
}
}
}
Error Solution:
You need to add using System.Collections.Generic;
Namespace to get List<int>
using System;
using System.Collections.Generic;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
List<int> objList = new List<int>();
}
}
}
Output:
Program compiled successfully.
Post a comment
Please share your valuable feedback and share this article in social media.