G
Guest
Hi,
The following code snippet doesn’t compile with,
helloworld.cs(25,39): error CS0246: The type or namespace name 'Library' could not be found (are you missing a using directive or an assembly reference?)
Why can’t the “Library†namespace be found when its location “Company.Application†has been referenced in the Tester class.
using System;
namespace Company.Application.Library
{
class Math
{
public static int Add(int a, int b)
{
return(a + b);
}
}
}
namespace Test
{
using Company.Application;
class Tester
{
static void Main()
{
int iResult = Library.Math.Add(2, 2);
Console.WriteLine(iResult);
}
}
}
The following code snippet doesn’t compile with,
helloworld.cs(25,39): error CS0246: The type or namespace name 'Library' could not be found (are you missing a using directive or an assembly reference?)
Why can’t the “Library†namespace be found when its location “Company.Application†has been referenced in the Tester class.
using System;
namespace Company.Application.Library
{
class Math
{
public static int Add(int a, int b)
{
return(a + b);
}
}
}
namespace Test
{
using Company.Application;
class Tester
{
static void Main()
{
int iResult = Library.Math.Add(2, 2);
Console.WriteLine(iResult);
}
}
}