For Programmers: Free Programming Magazines  


Home > Archive > C# > March 2004 > Preventing included namespaces from being shared









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Preventing included namespaces from being shared
Alex

2004-03-28, 10:28 pm

Hi all,

Just wondering if anyone has a solution to this problem.

I've created a class library which encapsulates some logon code.
This library uses one of my registry classes as well as some ODBC
database access queries, so the top of the main code looks like this:

using System;
using System.Data.Odbc;
using RegistryAccess;

(Where RegistryAccess is my registry access namespace)

The problem arises when I add this class library to another solution,
it seems to share RegistryAccess with the parent solution, conflicting
with locally-included copies, producing compiler warnings like this:

c:\newcvs\server software\logon server\commondata.cs(97,17): warning
CS1595: 'RegistryAccess.clsRegistry' is defined in multiple places;
using definition from 'C:\newcvs\Common\clsRegistry.cs'

This is acceptable, since the compiler has chosen the correct one, but
I would still prefer that the namespace is kept out of the public view
of the class library.

Any ideas?

Cheers,

Alex.
Remove ernie and bert from email address to reply.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com