I am writing the code right, but getting error - missing namespace or assembly reference.Is there something wrong with the code or I am missing something?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
int i = 0;
int sum = 0;
int[] arr = new int[] { 1, 2 };
do
{
{
sum += arr[1];
Console.WriteLine("Wow");
i++;
}
}
while (i < 3);
}
}
}
Error is : Error Cannot initialize type 'int' with a collection initializer because it does not implement 'System.Collections.IEnumerable
In order to resolve this error, they have to delete the current reference and re-add the reference.
If you hover your mouse over the red line under GridLayoutGroup (provided you use visual studio as your IDE) then a light bulb should appear. Hover your mouse over the light bulb, you will have an option like "Using UnityEngine. UI" click on it and your problem will be solved.
My namespace ended in Console
(i.e. MyProject.Console
) which messed up the calls to Console.Write
. In this case, either write the fully qualified name System.Console.Write
or change the namespace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With