Visibility query

  • Thread starter Thread starter Paolo
  • Start date Start date
P

Paolo

I have a 'Utilities'dll' defined broadly thus:

namespace Utilities
{
public static class Utils
{
public const int SOMECONST = 1;

public static void someFunc()
{
}
}

I have included a reference to Utilities.dll in my application. The
function is 'seen' by the application but use of the const gives
"'Utilities.Utils' does not contain a definition for SOMECONST".

It's probably something simple but I'm a bit stumped.
 
Paolo said:
I have a 'Utilities'dll' defined broadly thus:

namespace Utilities
{
public static class Utils
{
public const int SOMECONST = 1;

public static void someFunc()
{
}
}

I have included a reference to Utilities.dll in my application. The
function is 'seen' by the application but use of the const gives
"'Utilities.Utils' does not contain a definition for SOMECONST".

It's probably something simple but I'm a bit stumped.

Your problem must be somewhere else. I just typed the following into a
console application in Visual Studio 2008 and it compiles with no problem.
In fact, when I type "Utilities.Utils." inside Main, Intellisense does offer
"SOMECONST".

using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int x = Utilities.Utils.SOMECONST;
}
}
}
namespace Utilities
{
public static class Utils
{
public const int SOMECONST = 1;
}
}
 
I have a 'Utilities'dll' defined broadly thus:

namespace Utilities
{
   public static class Utils
    {
      public const int SOMECONST = 1;

      public static void someFunc()
      {
      }

}

I have included a reference to Utilities.dll  in my application. The
function is 'seen' by the application but use of the const gives
"'Utilities.Utils' does not contain a definition for SOMECONST".

It's probably something simple but I'm a bit stumped.

Hi,

I also think that your problem is soemwhere else, r u sure that your
app does not define a namespace named Utilities?
Do a right click where you use the method (your function) and select
Go To Definition
 
Alberto: it was a simple mistyping error - doh!

Alberto Poblacion said:
Paolo said:
I have a 'Utilities'dll' defined broadly thus:

namespace Utilities
{
public static class Utils
{
public const int SOMECONST = 1;

public static void someFunc()
{
}
}

I have included a reference to Utilities.dll in my application. The
function is 'seen' by the application but use of the const gives
"'Utilities.Utils' does not contain a definition for SOMECONST".

It's probably something simple but I'm a bit stumped.

Your problem must be somewhere else. I just typed the following into a
console application in Visual Studio 2008 and it compiles with no problem.
In fact, when I type "Utilities.Utils." inside Main, Intellisense does offer
"SOMECONST".

using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int x = Utilities.Utils.SOMECONST;
}
}
}
namespace Utilities
{
public static class Utils
{
public const int SOMECONST = 1;
}
}
 
Ignacio: it was a simple mistyping error - doh!

Ignacio Machin ( .NET/ C# MVP ) said:
Hi,

I also think that your problem is soemwhere else, r u sure that your
app does not define a namespace named Utilities?
Do a right click where you use the method (your function) and select
Go To Definition
 
Back
Top