Edit: Changing the class name or namespace name so that the namespace and class don't have the same name doesn't fix this issue.
I have this super simple code:
Program.cs:
using System;
using CodeCleaner;
class Program
{
private static void Main(string[] args)
{
Console.WriteLine("DocTypeChecker instantiated");
var codeCleaner = new CodeCleaner.CodeCleaner();
}
}
CodeCleaner.cs:
using System;
namespace CodeCleaner
{
public class CodeCleaner
{
public CodeCleaner()
{
Console.WriteLine("CodeCleaner instantiated");
}
}
}
This produces the following error when I try to compile when I run $ csc Program.cs:
Program.cs(4,7): error CS0246: The type or namespace name 'CodeCleaner' could not be found (are you missing a using directive or an assembly reference?).
I'm definitely not missing a using directive for CodeCleaner, but what it means with assembly reference I have no idea. Other solutions on the web didn't help me in this case. Anyone know the issue here?
NCodeCleanerand the issue persists (it then saysnamespace name 'NCodeCleaner' not found), so same issue. - erol_smsrnew CodeCleaner.CodeCleaner()- Ashkan Mobayen Khiabani