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

Aliasing duplicated namespaces in seperate dll's

I have two assemblies with a different implementation of the same class Lets
say ns1 and ns1 with the class Widget.

I add the references to the project and put in aliases in each of the
properties for the libraries as w1 and w2 and before my using imports, I
put

extern alias w1;
extern alias w2;

Its fine until I try to compille and then I get the error.

cannot reference directories. Can someone tell me where Im going wrong here.

Thanks
Jun 27 '08 #1
2 1595
On Apr 27, 1:17*pm, "OHM \( One Handed Man \)" <m...@myplace.com>
wrote:
I have two assemblies with a different implementation of the same class Lets
say *ns1 and ns1 with the class *Widget.

I add the references to the project and put in aliases in each of the
properties for the libraries as w1 and w2 *and before my using imports, I
put

extern alias w1;
extern alias w2;

Its fine until I try to compille and then I get the error.

cannot reference directories. Can someone tell me where Im going wrong here.

Thanks
If you're wanting to alias namespaces then do the following.

using MyNamespace1 = w1;
using MyNamespace2 = w2;

Is that what you're looking for? Or are you saying that the classes
just happen to have the same namespace path? If they do then you'll
have to tell the compiler you want to alias the assemblies before you
can use the extern alias statement. See the following link.

<http://msdn2.microsoft.com/en-us/library/ms173212(VS.80).aspx>
Jun 27 '08 #2
>Is that what you're looking for? Or are you saying that the classes
>just happen to have the same namespace path? If they do then you'll
have to tell the compiler you want to alias the assemblies before you
can use the extern alias statement. See the following link.
yes, the same fully qualified namespace in two different assemblies. I added
the aliases by selecting the properties of the dll'S AND filling in w1 and
w2 respectively before using the extern keyword. However it results in the
error message I explained, perhaps what I did was incorrect. ?

Cheers

"Brian Gideon" <br*********@yahoo.comwrote in message
news:e5**********************************@m3g2000h sc.googlegroups.com...
On Apr 27, 1:17 pm, "OHM \( One Handed Man \)" <m...@myplace.com>
wrote:
I have two assemblies with a different implementation of the same class
Lets
say ns1 and ns1 with the class Widget.

I add the references to the project and put in aliases in each of the
properties for the libraries as w1 and w2 and before my using imports, I
put

extern alias w1;
extern alias w2;

Its fine until I try to compille and then I get the error.

cannot reference directories. Can someone tell me where Im going wrong
here.

Thanks
If you're wanting to alias namespaces then do the following.

using MyNamespace1 = w1;
using MyNamespace2 = w2;

Is that what you're looking for? Or are you saying that the classes
just happen to have the same namespace path? If they do then you'll
have to tell the compiler you want to alias the assemblies before you
can use the extern alias statement. See the following link.

<http://msdn2.microsoft.com/en-us/library/ms173212(VS.80).aspx>
Jun 27 '08 #3

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

Similar topics

5
by: EMonaco | last post by:
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...
3
by: Jim Heavey | last post by:
Trying to get the hang of Namespaces. I have primarly developed in VB and am transitioning to C# and the .Net Environment. I have worked a bit with Java as well in school about a year or so ago....
1
by: dhnriverside | last post by:
Hi peeps I want to create some namespaces and dlls to encapsulate some common functionality. Here's what I want. Me Me.CompanyA Me.CompanyA.BusinessObjects Me.CompanyB....
5
by: geoffblanduk_nospam | last post by:
Is it valid to share namespaces across projects in C#? For example, I have a project that contains the code for a core assembly, this builds a DLL. I then have a second project in the same...
17
by: clintonG | last post by:
Using 2.0 with Master Pages and a GlobalBaseClass for the content pages. I understand the easy part -- the hierarchical structure of a namespace naming convention -- but the 2.0 IDE does not...
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...
2
by: Jack Li | last post by:
Hi, If I declare multiple namspaces, each in a separate file, how do I specify their path with the "using" directives? Say I have 2 namespaces and 1 main function, all in separate files such as...
1
by: juan blanco | last post by:
Hi all, I am trying to compile / rebuild a solution with msbuild to be part of our continuous integration. One of the projects aliases a referenced project to resolve confilicting namespaces....
1
by: Ray | last post by:
Hello, I'm reading Mr. Flanagan's JS Definitive Guide 5th edition. I was wondering about a point he make in section 10.2 of the book: "Importing Symbols from Namespaces". He mentions in there...
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: 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
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
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
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 project—planning, 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.