471,325 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

Visibility query

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.

Aug 22 '08 #1
4 1032
"Paolo" <Pa***@discussions.microsoft.comwrote in message
news:05**********************************@microsof t.com...
>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;
}
}
Aug 22 '08 #2
On Aug 21, 11:42*pm, Paolo <Pa...@discussions.microsoft.comwrote:
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
Aug 22 '08 #3
Alberto: it was a simple mistyping error - doh!

"Alberto Poblacion" wrote:
"Paolo" <Pa***@discussions.microsoft.comwrote in message
news:05**********************************@microsof t.com...
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;
}
}
Aug 23 '08 #4
Ignacio: it was a simple mistyping error - doh!

"Ignacio Machin ( .NET/ C# MVP )" wrote:
On Aug 21, 11:42 pm, Paolo <Pa...@discussions.microsoft.comwrote:
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
Aug 23 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jukka K. Korpela | last post: by
8 posts views Thread by TTroy | last post: by
1 post views Thread by Jim Heavey | last post: by
4 posts views Thread by Colin Desmond | last post: by
11 posts views Thread by -D- | last post: by
6 posts views Thread by BOMEz | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.