473,396 Members | 1,929 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,396 software developers and data experts.

Internal classes

Hi all

I can access an internal class by this method if I do it within the
namespace

{
namespace ClassTest

public class1
{
internal class class2
{
}
}

public class Tester
{
class1.class2 myclass2 = new class1.class2
}
}
but if I try outside the namespace say the above is in a dll and in a
different
project I add a reference to the dll

ClassTest.class1.class2 >>> doesn't show up or work if set to internal
I need to change internal to public to access
Is that normal?

Regards

Michael
Nov 15 '05 #1
2 6629

"Michael C" <as***@askme.com> wrote in message
news:#G*************@TK2MSFTNGP12.phx.gbl...
Hi all

I can access an internal class by this method if I do it within the
namespace

{
namespace ClassTest

public class1
{
internal class class2
{
}
}

public class Tester
{
class1.class2 myclass2 = new class1.class2
}
}
but if I try outside the namespace say the above is in a dll and in a
different
project I add a reference to the dll

ClassTest.class1.class2 >>> doesn't show up or work if set to internal I need to change internal to public to access
Is that normal?


Yes, it is. 'internal' is used to define object that are only to be usable
within a single library (DLL). That is to say, your internal class is
handled like public classes inside your first DLL, but it looks like a
private class from the point of view of other projects or executables.
Nov 15 '05 #2

"Michael C" <as***@askme.com> wrote in message
news:#G*************@TK2MSFTNGP12.phx.gbl...
Hi all

I can access an internal class by this method if I do it within the
namespace

{
namespace ClassTest

public class1
{
internal class class2
{
}
}

public class Tester
{
class1.class2 myclass2 = new class1.class2
}
}
but if I try outside the namespace say the above is in a dll and in a
different
project I add a reference to the dll

ClassTest.class1.class2 >>> doesn't show up or work if set to internal I need to change internal to public to access
Is that normal?


Yes, it is. 'internal' is used to define object that are only to be usable
within a single library (DLL). That is to say, your internal class is
handled like public classes inside your first DLL, but it looks like a
private class from the point of view of other projects or executables.
Nov 15 '05 #3

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

Similar topics

8
by: Carlos J. Quintero | last post by:
Hi, As you know the current keywords "protected internal" (C#) or "Protected Friend" (VB.Net) means "Protected Or internal" (C#) or "Protected Or Friend" (VB.Net), that is, the member is...
7
by: Jesper | last post by:
I need to grant a class access to protected fields of another class in the way its possible in C++ with the friend keyword. However I would like to keep the class protected towards other class...
2
by: Chien Lau | last post by:
I frequently define internal UserControl-derived classes in my WinForms apps: internal class MyUserControl:UserControl{ ... } I'll often need to embed these controls in a Form, whose class...
2
by: Kolozs, Áron | last post by:
Hi everybody, The C# compiler reports a Compiler Error CS0052 in the following situation: I declared a type marked as "internal": namespace MyNamespace { internal class MyInteralClass
5
by: mmkhajah | last post by:
Hi, I am trying to have a set of base classes and interfaces of an application framework in their own assembly. That way, concrete implementations of the API will reference that assembly and...
9
by: JT | last post by:
Here is the overall structure I will be referring to: End-program ProvideWorkFlow.dll Forms and methods that properly manipulate calls to methods in AccessUtils AccessUtils (a web service)...
13
by: Clive Dixon | last post by:
I am refactoring some code to move some base classes into a separate assembly. One of these base classes has a member property which is 'protected internal'. However when I move these base classes...
3
by: guiroux22 | last post by:
Hi everybody, I have two assemblies. The first is used by the client sites and provides some public classes using internal classes (access must be restrictive). The second is an "administrative"...
9
by: dylan.miller | last post by:
I'm having trouble understanding the internal access modifier. There are many classes in my assembly that should not be accessible outside of the assembly. I've used the internal access modifier...
4
by: bob_jenkins | last post by:
C# allows code to be generated, but the generated code is in its own assembly. Is there a way for that generated code to access internal classes in the assembly that produced it? To have the...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

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.