473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Question about namespaces and classes...

All,

I have a simple C# window app under MyApp namespace it has a class Form1.
I've added another class .cs file.
Now this class I want to share with many projects, so I figured I'd change
this class.cs file from

namespace MyApp
Class MyClass

to:
namespace MyCompanyName
namespace LogicalGroup
class MyNewClassName

In the form class I try
MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunction() and it
complains that MyCompanyName namespace could not be found? I tried a using
MyCompanyName and the namespaces I just created do not show up in
intellisense</> popups.

Obviously I need to do this a bit differently to get it to work, but I don't
want a separate assembly, dll or exe that will need to be installed or
copied in order to do this. What am I missing or is there a different route
I need to take?
Regards,
Erin.
Nov 15 '05 #1
5 1281
Joe,

Done that. Comment out the
MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunc() and it compile
fine.
Remove the // and compile and viola, same error as before.... *sigh*
Erin.

"Joe Mayo" <jm***@ddiieessppaammeerrssddiiee.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
What you're trying to do looks okay to me. I've had this type of problem
when there was some other type of error in the file, which causes
intellisense not to show on the line I'm working with. Maybe you could
remove the reference, get a good compile, and try again.

Joe
--
http://www.csharp-station.com

"EMonaco" <er********@nospam.net> wrote in message
news:ON*************@TK2MSFTNGP12.phx.gbl...
All,

I have a simple C# window app under MyApp namespace it has a class

Form1.
I've added another class .cs file.
Now this class I want to share with many projects, so I figured I'd change this class.cs file from

namespace MyApp
Class MyClass

to:
namespace MyCompanyName
namespace LogicalGroup
class MyNewClassName

In the form class I try
MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunction() and it
complains that MyCompanyName namespace could not be found? I tried a using MyCompanyName and the namespaces I just created do not show up in
intellisense</> popups.

Obviously I need to do this a bit differently to get it to work, but I

don't
want a separate assembly, dll or exe that will need to be installed or
copied in order to do this. What am I missing or is there a different

route
I need to take?
Regards,
Erin.


Nov 15 '05 #2
Is the class in a separate assembly? If so, did you accidently lose your
reference? I suppose if you press Ctrl-Space MyCompanyName doesn't appear
in the list.

Joe
--
http://www.csharp-station.com

"EMonaco" <er********@nospam.net> wrote in message
news:uP**************@TK2MSFTNGP10.phx.gbl...
Joe,

Done that. Comment out the
MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunc() and it compile
fine.
Remove the // and compile and viola, same error as before.... *sigh*
Erin.

"Joe Mayo" <jm***@ddiieessppaammeerrssddiiee.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
What you're trying to do looks okay to me. I've had this type of problem
when there was some other type of error in the file, which causes
intellisense not to show on the line I'm working with. Maybe you could
remove the reference, get a good compile, and try again.

Joe
--
http://www.csharp-station.com

"EMonaco" <er********@nospam.net> wrote in message
news:ON*************@TK2MSFTNGP12.phx.gbl...
All,

I have a simple C# window app under MyApp namespace it has a class

Form1.
I've added another class .cs file.
Now this class I want to share with many projects, so I figured I'd

change this class.cs file from

namespace MyApp
Class MyClass

to:
namespace MyCompanyName
namespace LogicalGroup
class MyNewClassName

In the form class I try
MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunction() and it complains that MyCompanyName namespace could not be found? I tried a using MyCompanyName and the namespaces I just created do not show up in
intellisense</> popups.

Obviously I need to do this a bit differently to get it to work, but I

don't
want a separate assembly, dll or exe that will need to be installed or
copied in order to do this. What am I missing or is there a different

route
I need to take?
Regards,
Erin.



Nov 15 '05 #3

Hi EMonaco,

Have you compiled before using your customer class?
In my sample project, it just works well.

Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "EMonaco" <er********@nospam.net>
| References: <ON*************@TK2MSFTNGP12.phx.gbl>
<#F**************@TK2MSFTNGP10.phx.gbl>
| Subject: Re: Question about namespaces and classes...
| Date: Tue, 26 Aug 2003 20:33:51 -0400
| Lines: 63
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <uP**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: bgp01114046bgs.westln01.mi.comcast.net 68.42.93.214
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:179688
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Joe,
|
| Done that. Comment out the
| MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunc() and it compile
| fine.
| Remove the // and compile and viola, same error as before.... *sigh*
|
|
| Erin.
|
| "Joe Mayo" <jm***@ddiieessppaammeerrssddiiee.com> wrote in message
| news:%2****************@TK2MSFTNGP10.phx.gbl...
| > What you're trying to do looks okay to me. I've had this type of
problem
| > when there was some other type of error in the file, which causes
| > intellisense not to show on the line I'm working with. Maybe you could
| > remove the reference, get a good compile, and try again.
| >
| > Joe
| > --
| > http://www.csharp-station.com
| >
| > "EMonaco" <er********@nospam.net> wrote in message
| > news:ON*************@TK2MSFTNGP12.phx.gbl...
| > > All,
| > >
| > > I have a simple C# window app under MyApp namespace it has a class
| > Form1.
| > > I've added another class .cs file.
| > > Now this class I want to share with many projects, so I figured I'd
| change
| > > this class.cs file from
| > >
| > > namespace MyApp
| > > Class MyClass
| > >
| > > to:
| > > namespace MyCompanyName
| > > namespace LogicalGroup
| > > class MyNewClassName
| > >
| > > In the form class I try
| > > MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunction() and
it
| > > complains that MyCompanyName namespace could not be found? I tried a
| using
| > > MyCompanyName and the namespaces I just created do not show up in
| > > intellisense</> popups.
| > >
| > > Obviously I need to do this a bit differently to get it to work, but I
| > don't
| > > want a separate assembly, dll or exe that will need to be installed or
| > > copied in order to do this. What am I missing or is there a different
| > route
| > > I need to take?
| > >
| > >
| > > Regards,
| > > Erin.
| > >
| > >
| >
| >
|
|
|

Nov 15 '05 #4
Joe,

The class is a seperate .cs file included as part of the project.
If I switch to the Class View pane I can see both (top level) namespaces,
and all the class, members, etc below them!
If I do ctrl-space I *do* see DataBasementSoftware.... recompile- still
nothing.
So I deleted the line, ctrl-space will not bring the popup when i have an
incomplete line such as this.rtbTextToPass =
I deleted the line again. Start with ctrl-space, go through the popup
namespaces MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunction(
then put in the args that displayed, terminated it with ): and then went to
the start and added the this.rtbTextToPass = in front of it... recompiled
and what do you know... it worked!

Went back to the original- checked case and spelling and its identical, so I
don't know what gives with that!?
Thanks for the help though. Have to remember that ctrl-space trick. As a
side note- I wish intellisense would always work- I've noticed if you have
errors- (ie; forget the ; terminator have mismatched ()'s etc, that it will
no longer show).

Erin.
"Joe Mayo" <jm***@ddiieessppaammeerrssddiiee.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Is the class in a separate assembly? If so, did you accidently lose your
reference? I suppose if you press Ctrl-Space MyCompanyName doesn't appear
in the list.

Joe
--
http://www.csharp-station.com

"EMonaco" <er********@nospam.net> wrote in message
news:uP**************@TK2MSFTNGP10.phx.gbl...
Joe,

Done that. Comment out the
MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunc() and it compile
fine.
Remove the // and compile and viola, same error as before.... *sigh*
Erin.

"Joe Mayo" <jm***@ddiieessppaammeerrssddiiee.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
What you're trying to do looks okay to me. I've had this type of

problem when there was some other type of error in the file, which causes
intellisense not to show on the line I'm working with. Maybe you could remove the reference, get a good compile, and try again.

Joe
--
http://www.csharp-station.com

"EMonaco" <er********@nospam.net> wrote in message
news:ON*************@TK2MSFTNGP12.phx.gbl...
> All,
>
> I have a simple C# window app under MyApp namespace it has a class
Form1.
> I've added another class .cs file.
> Now this class I want to share with many projects, so I figured I'd

change
> this class.cs file from
>
> namespace MyApp
> Class MyClass
>
> to:
> namespace MyCompanyName
> namespace LogicalGroup
> class MyNewClassName
>
> In the form class I try
> MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunction() and it > complains that MyCompanyName namespace could not be found? I tried a

using
> MyCompanyName and the namespaces I just created do not show up in
> intellisense</> popups.
>
> Obviously I need to do this a bit differently to get it to work, but I don't
> want a separate assembly, dll or exe that will need to be installed or > copied in order to do this. What am I missing or is there a different route
> I need to take?
>
>
> Regards,
> Erin.
>
>



Nov 15 '05 #5

Hi Joe,

I am glad it worked finally.
I recommand you do the same thing in a new project to find if the problem
still arise.
If it still arise, please feel free to tell me

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "EMonaco" <er********@nospam.net>
| References: <ON*************@TK2MSFTNGP12.phx.gbl>
<#F**************@TK2MSFTNGP10.phx.gbl>
<uP**************@TK2MSFTNGP10.phx.gbl>
<#L**************@tk2msftngp13.phx.gbl>
| Subject: Re: Question about namespaces and classes...
| Date: Tue, 26 Aug 2003 22:03:02 -0400
| Lines: 113
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <uK**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: bgp01114046bgs.westln01.mi.comcast.net 68.42.93.214
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:179705
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Joe,
|
| The class is a seperate .cs file included as part of the project.
| If I switch to the Class View pane I can see both (top level)
namespaces,
| and all the class, members, etc below them!
| If I do ctrl-space I *do* see DataBasementSoftware.... recompile- still
| nothing.
|
|
| So I deleted the line, ctrl-space will not bring the popup when i have
an
| incomplete line such as this.rtbTextToPass =
| I deleted the line again. Start with ctrl-space, go through the popup
| namespaces MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunction(
| then put in the args that displayed, terminated it with ): and then went
to
| the start and added the this.rtbTextToPass = in front of it... recompiled
| and what do you know... it worked!
|
| Went back to the original- checked case and spelling and its identical,
so I
| don't know what gives with that!?
| Thanks for the help though. Have to remember that ctrl-space trick. As a
| side note- I wish intellisense would always work- I've noticed if you have
| errors- (ie; forget the ; terminator have mismatched ()'s etc, that it
will
| no longer show).
|
| Erin.
|
|
| "Joe Mayo" <jm***@ddiieessppaammeerrssddiiee.com> wrote in message
| news:%2****************@tk2msftngp13.phx.gbl...
| > Is the class in a separate assembly? If so, did you accidently lose
your
| > reference? I suppose if you press Ctrl-Space MyCompanyName doesn't
appear
| > in the list.
| >
| > Joe
| > --
| > http://www.csharp-station.com
| >
| > "EMonaco" <er********@nospam.net> wrote in message
| > news:uP**************@TK2MSFTNGP10.phx.gbl...
| > > Joe,
| > >
| > > Done that. Comment out the
| > > MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunc() and it
| compile
| > > fine.
| > > Remove the // and compile and viola, same error as before.... *sigh*
| > >
| > >
| > > Erin.
| > >
| > > "Joe Mayo" <jm***@ddiieessppaammeerrssddiiee.com> wrote in message
| > > news:%2****************@TK2MSFTNGP10.phx.gbl...
| > > > What you're trying to do looks okay to me. I've had this type of
| > problem
| > > > when there was some other type of error in the file, which causes
| > > > intellisense not to show on the line I'm working with. Maybe you
| could
| > > > remove the reference, get a good compile, and try again.
| > > >
| > > > Joe
| > > > --
| > > > http://www.csharp-station.com
| > > >
| > > > "EMonaco" <er********@nospam.net> wrote in message
| > > > news:ON*************@TK2MSFTNGP12.phx.gbl...
| > > > > All,
| > > > >
| > > > > I have a simple C# window app under MyApp namespace it has a
class
| > > > Form1.
| > > > > I've added another class .cs file.
| > > > > Now this class I want to share with many projects, so I figured
I'd
| > > change
| > > > > this class.cs file from
| > > > >
| > > > > namespace MyApp
| > > > > Class MyClass
| > > > >
| > > > > to:
| > > > > namespace MyCompanyName
| > > > > namespace LogicalGroup
| > > > > class MyNewClassName
| > > > >
| > > > > In the form class I try
| > > > > MyCompanyName.LogicalGroup.MyNewClassName.thisstat icfunction()
and
| > it
| > > > > complains that MyCompanyName namespace could not be found? I
tried a
| > > using
| > > > > MyCompanyName and the namespaces I just created do not show up in
| > > > > intellisense</> popups.
| > > > >
| > > > > Obviously I need to do this a bit differently to get it to work,
but
| I
| > > > don't
| > > > > want a separate assembly, dll or exe that will need to be
installed
| or
| > > > > copied in order to do this. What am I missing or is there a
| different
| > > > route
| > > > > I need to take?
| > > > >
| > > > >
| > > > > Regards,
| > > > > Erin.
| > > > >
| > > > >
| > > >
| > > >
| > >
| > >
| >
| >
|
|
|

Nov 15 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Random | last post by:
I'm confused about the proper use and usefulness of namespaces. I beleive I understand the purpose is so the developer can put classes within namespaces to essentially organize your code. And I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.