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

Hide 'empty' namespace from extarnal assemblies.

Hi.

I am working on a class library where I have a namespace called
MyProject.Implementation.
This namespace only have internal and private classes.

However, when I use my .dll assembly in a WinForm application, that
application can still see the namespace via Intellisense. For the consumer
it appears to be an empty namespace.

As access modifiers are not allowed on namespaces, is there another way to
signal, to visual studio (or other tools), that the namespace should be
'invisible' to outside consumers? An attribute perhaps?

Best Regards
- Michael Starberg
Aug 23 '07 #1
3 3664
Hi,
"Michael S" <no@no.nowrote in message
news:eH**************@TK2MSFTNGP04.phx.gbl...
Hi.

I am working on a class library where I have a namespace called
MyProject.Implementation.
This namespace only have internal and private classes.

However, when I use my .dll assembly in a WinForm application, that
application can still see the namespace via Intellisense. For the consumer
it appears to be an empty namespace.

As access modifiers are not allowed on namespaces, is there another way to
signal, to visual studio (or other tools), that the namespace should be
'invisible' to outside consumers? An attribute perhaps?

The only attribute I know of for this is EditorBrowsable:

[System.ComponentModel.EditorBrowsable(System.Compo nentModel.EditorBrowsableState.Never)]

not sure if you can apply it to a namespace though, you can try and post
back yor result :)
Aug 23 '07 #2
Error 1 A namespace declaration cannot have modifiers or attributes
D:\Projects\coredc\trunc\Implementation\DcConnecti on.cs 9 1 CoreDC

Guess I have to live with the empty namespace. No big deal.

- Michael Starberg
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:ei**************@TK2MSFTNGP03.phx.gbl...
Hi,
"Michael S" <no@no.nowrote in message
news:eH**************@TK2MSFTNGP04.phx.gbl...
>Hi.

I am working on a class library where I have a namespace called
MyProject.Implementation.
This namespace only have internal and private classes.

However, when I use my .dll assembly in a WinForm application, that
application can still see the namespace via Intellisense. For the
consumer it appears to be an empty namespace.

As access modifiers are not allowed on namespaces, is there another way
to signal, to visual studio (or other tools), that the namespace should
be 'invisible' to outside consumers? An attribute perhaps?


The only attribute I know of for this is EditorBrowsable:

[System.ComponentModel.EditorBrowsable(System.Compo nentModel.EditorBrowsableState.Never)]

not sure if you can apply it to a namespace though, you can try and post
back yor result :)

Aug 23 '07 #3

"Michael S" <no@no.nowrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
Error 1 A namespace declaration cannot have modifiers or attributes
D:\Projects\coredc\trunc\Implementation\DcConnecti on.cs 9 1 CoreDC

Guess I have to live with the empty namespace. No big deal.
How about using an internal static partial class instead of a namespace?
>
- Michael Starberg
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:ei**************@TK2MSFTNGP03.phx.gbl...
>Hi,
"Michael S" <no@no.nowrote in message
news:eH**************@TK2MSFTNGP04.phx.gbl...
>>Hi.

I am working on a class library where I have a namespace called
MyProject.Implementation.
This namespace only have internal and private classes.

However, when I use my .dll assembly in a WinForm application, that
application can still see the namespace via Intellisense. For the
consumer it appears to be an empty namespace.

As access modifiers are not allowed on namespaces, is there another way
to signal, to visual studio (or other tools), that the namespace should
be 'invisible' to outside consumers? An attribute perhaps?


The only attribute I know of for this is EditorBrowsable:

[System.ComponentModel.EditorBrowsable(System.Compo nentModel.EditorBrowsableState.Never)]

not sure if you can apply it to a namespace though, you can try and post
back yor result :)


Aug 27 '07 #4

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

Similar topics

3
by: thechaosengine | last post by:
Hi all, Can anyone tell me if it is advisable (or even possible) to define a namespace across 2 or more assemblies? For example, consider the namespace SampleApplication.Data.Providers ...
0
by: Efkas | last post by:
I have a full custom application with some widged extending Controls like Label and PictureBox. I build a menu with these widgets. When I click on one of them, it calls a function to display...
7
by: thechaosengine | last post by:
Hi all, Can anyone tell me if it is advisable (or even possible) to define a namespace across 2 or more assemblies? For example, consider the namespace SampleApplication.Data.Providers ...
29
by: Natan | last post by:
When you create and aspx page, this is generated by default: using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Text; using...
10
by: Richard Brown | last post by:
I think I might be on track to a misnomer that I keep running into. A lot of the assemblies that I reference are named "System", "System.Drawing", etc. There are dlls, ie, system.dll and...
29
by: Tiraman | last post by:
Hi, I Build my own dll with my own namespace name and i would like to put it in one place but for the project bin folder so all of the projects will be able to use it . i tried to put the dll...
1
by: Tom Edelbrok | last post by:
I'm upgrading from VB6 to VS.Net Pro 2003, and am trying to plan a way of using NAMESPACE's. Under VB6 we had a variety of global procedures stored in a series of modules, as well as in classes....
3
by: | last post by:
I'm using the DataList and GridView controls, and I am trying to wrap my head around the problem of conditionally showing or hiding cells/cell content based on the presence or absence of DB data. I...
26
by: anonieko | last post by:
In the past I always used "" everywhere for empty string in my code without a problem. Now, do you think I should use String.Empty instead of "" (at all times) ? Let me know your thoughts.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.