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

Class interface sharing

Hi,
I have a problem with reuse of the same class interface.
I have two user controls which uses the same IAppElement interface.
When I use both controls I recieve warning message warning CS0436 -
because the same interfaces is defined in two assemblies with the same
name/namespace.

I know that I can avoid this using additional assembly for both
controls but I'm looking different solution with give me ability to
reuse imported definition.
Regards
Mikolaj

Apr 19 '06 #1
2 3257
fujiy...@gmail.com wrote:
I have a problem with reuse of the same class interface.
I have two user controls which uses the same IAppElement interface.
When I use both controls I recieve warning message warning CS0436 -
because the same interfaces is defined in two assemblies with the same
name/namespace.

I know that I can avoid this using additional assembly for both
controls but I'm looking different solution with give me ability to
reuse imported definition.


With C# 2.0 you *can* use extern aliases to do this - but I really
wouldn't. You'd have to use the correct alias each time. Note that even
though the types have the same name and the same members, they are
currently different types as far as the computer is concerned.

You really should put them into a common assembly - it's the right way
of doing things.

Jon

Apr 19 '06 #2
Hi,

Did you do the two controls?

If so you should read the plug-in article of Jon's at
http://www.yoda.arachsys.com/csharp/plugin.html , basically you need to
define the interface ONCE and reference it from all other possible
projects/namespace .

It's common to define it in the same project where you define your "base"
or default implementation, this avoid you the overload of having a separate
project just for the interfaces.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

<fu******@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi,
I have a problem with reuse of the same class interface.
I have two user controls which uses the same IAppElement interface.
When I use both controls I recieve warning message warning CS0436 -
because the same interfaces is defined in two assemblies with the same
name/namespace.

I know that I can avoid this using additional assembly for both
controls but I'm looking different solution with give me ability to
reuse imported definition.
Regards
Mikolaj

Apr 19 '06 #3

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

Similar topics

9
by: Tom Evans | last post by:
My basic question: If I have a specific interface which I know is going to be implemented by a number of classes, but there is no implementation commonality between them, what is the preferred...
8
by: Matthew Bell | last post by:
Hi, I've got a question about whether there are any issues with directly calling attributes and/or methods of a threaded class instance. I wonder if someone could give me some advice on this. ...
3
by: gry | last post by:
I often find myself wanting an instance attribute that can take on only a few fixed symbolic values. (This is less functionality than an enum, since there are no *numbers* associated with the...
42
by: Dan | last post by:
Hello, I have trouble with class calling. I am calling getvolume() with succes in the function CreateCircle but it do not want to call it in ShowCircle() function. I am staying in the same...
8
by: John | last post by:
We are looking to converting our old vb 6.0 apps to vb.net. In vb6 you could create a standard set of forms or modules that you could share with each application. As a result, lets say you...
11
by: Full Decent | last post by:
Hey all! I've been using PHP for a while and I'm hearing that I should look into using it OO. I'm looking into making changes to the program Camera Life (http://fdcl.sf.net). I want to abstract...
17
by: Fabry | last post by:
Hi All, I'm new of this group and I do not know if this is the correct group for my question. I have a DLL with its export library (.lib) wrote in Borland C++ 6. In borland everything is OK and...
70
by: garyusenet | last post by:
I'm using an example piece of code: - namespace Wintellect.Interop.Sound{ using System; using System.Runtime.InteropServices; using System.ComponentModel; sealed class Sound{ public static...
5
by: Josh | last post by:
I have application1 that connects to webService1. I have a second application that references the same webservice (webService1). I need to pass an instance of a class returned from webService1...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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.