472,950 Members | 2,645 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,950 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 1077
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jonathan | last post by:
Hi, I've read through quite a number of postings on here so far and have seen what look like very simply, reasonable answers to this question, however I am still completely unable to do what I...
3
by: Jukka K. Korpela | last post by:
I have noticed that the meaning of visibility: collapse has been discussed on different forums, but with no consensus on what it really means. Besides, implementations differ. The specification...
12
by: lawrence | last post by:
The following function correctly makes everything invisible but then fails to turn the one chosen DIV back to visible. I imagine I'm getting the syntax of the variable wrong? I've tried this with...
4
by: lawrence | last post by:
Can anyone tell me why this code works in Netscape 7.1 but not in IE??? <SCRIPT type='text/javascript'> function makeVisible(nameOfDiv) {...
8
by: TTroy | last post by:
I have a few questions about "scope" and "visibility," which seem like two different things. To me "visibility" of the name of a function or object is the actual code that can use it in an...
0
by: | last post by:
Hello, I am working on a C# class project. In my project I used DataGrids to display query results. Everything was fine until I plugged in a WebService to display a simple text. After this, I...
1
by: Jim Heavey | last post by:
Hello, I create a HTML line as follows: <P class=text12BoldRed id=ErrTimePeriodSelection style="VISIBILITY: hidden" runat="server">Selection of time period either not made or more then one type...
4
by: Colin Desmond | last post by:
Is it possible to write an attribute that changes the visibility of a class (public/private) etc based on some pre-compiler define symbol? We're writing some classes which will be called by an...
11
by: -D- | last post by:
How can I turn the visibility of the xml control on or off? <%@ Control Language="c#" AutoEventWireup="false" Codebehind="TopNavBar.ascx.cs" Inherits="compass.user_controls.TopNavBar"...
6
by: BOMEz | last post by:
So i've recently been starting to program PHP in an object oriented way, but I'm running into some difficulties in from a design stand point and from an object oriented stand point: Issue 1: In my...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...

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.