I have a rather unique problem that I need some advice on.
I have multiple c# controls that need to make use of a common
namespace. So when I go to include both controls that make use of
that common namespace and one control has a newer version of that
namespace, the compiler complains about ambiguous references.
I've tried using compiler directives to manipulate the namespaces to
be different at compile time but vs.net 2005 keeps giving me grief
over them saying that
Warning 2 A namespace or class definition was found within a
conditional compilation directive in the file "BorderStrip.cs ". This
may lead to an incorrect choice for the manifest resource name for
resource "Common\BorderS trip.resx". MyUserControl2
anyone have any suggestions?
Jan 2 '06
11 3919
This is exactly what strong names and the GAC are for.
Of course they are far more useful to microsoft than to anyone else because
they are incompatible with no-touch/xcopy deployment which isn't a problem
for them as (1) the runtime is free (2) you can reasonably expect people to
install the latest.
This is also a good reason for sticking to the standard controls wherever
possible.
"alex sparsky" <al**@sparkysys tems.com> wrote in message
news:hs******** *************** *********@4ax.c om... this is a very astute observation. That is a very close example to what the reality is. The dll's are usually in the same directory and included into the same project. Those who are using an older version of a given library and don't want to upgrade every control will have the namespace conflict.
On Mon, 9 Jan 2006 09:23:37 -0500, "Stoitcho Goutsev \(100\)" <10*@100.com> wrote:
Michael,
I don't know what the Alex's problem actually is, but I can see where this can happen and updating control's is not possible. Imagine that I'm manufacture r of the common library. I sell this library to other companies and have released couple of versions. Other companies are using my library to in their own controls. Company A uses version 5 but company B has released their control using version 2 and doesn't want to upgrade for some reason. A customer buy controls from Company A and Company B and he/she cannot use them because of conflicting namespaces.
I don't see easy solution for this. If the common library is build fully bacword compatible the consumer of the controls can redirect the versions of the common library to use the latest one, but if the library is not backword compatible the only solution that I see is to use external aliases.
Nick,
Strong names in the GAC won't help in all of the cases. They will work as
long as all the types in the assemblies with the multiple versions are used
internally in the controls or users don't use the type names explicitly.
Imagine that there are multiple versions of the assembly foo.dll in the GAC
and there are two copies with different versions of that assembly loaded.
both assemblies expose a class called Foo.
As soon as the user decides to use that name in their code
Foo f = new Foo();
the compiler will fire an error because there are two types Foo comming from
different assemblies. The namespaces are the same, the name of the type is
the same. This problem has no resolution until .NET2.0 and external aliases.
--
Stoitcho Goutsev (100)
"Nick Hounsome" <nh***@nickhoun some.me.uk> wrote in message
news:sb******** ***********@fe1 .news.blueyonde r.co.uk... This is exactly what strong names and the GAC are for.
Of course they are far more useful to microsoft than to anyone else because they are incompatible with no-touch/xcopy deployment which isn't a problem for them as (1) the runtime is free (2) you can reasonably expect people to install the latest.
This is also a good reason for sticking to the standard controls wherever possible.
"alex sparsky" <al**@sparkysys tems.com> wrote in message news:hs******** *************** *********@4ax.c om... this is a very astute observation. That is a very close example to what the reality is. The dll's are usually in the same directory and included into the same project. Those who are using an older version of a given library and don't want to upgrade every control will have the namespace conflict.
On Mon, 9 Jan 2006 09:23:37 -0500, "Stoitcho Goutsev \(100\)" <10*@100.com> wrote:
Michael,
I don't know what the Alex's problem actually is, but I can see where this can happen and updating control's is not possible. Imagine that I'm manufactur er of the common library. I sell this library to other companies and have released couple of versions. Other companies are using my library to in their own controls. Company A uses version 5 but company B has released their control using version 2 and doesn't want to upgrade for some reason. A customer buy controls from Company A and Company B and he/she cannot use them because of conflicting namespaces.
I don't see easy solution for this. If the common library is build fully bacword compatible the consumer of the controls can redirect the versions of the common library to use the latest one, but if the library is not backword compatible the only solution that I see is to use external aliases.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: humble04 |
last post by:
Hi,
I am compiling a collection of C++ code. Most of them are using the new
format #include <iostream>. I think all of them because I failed at
finding out which header file uses the old format #include
<iostream.h>. However, I met the following error messages.
"/usr/vacpp/include/iostream.h", line 74.7: 1540-0400 (S) "class
ostream" has a conflicting declaration
"../include/myfile.h", line 7.1: 1540-0424 (I) "ostream" is declared on
|
by: user |
last post by:
Hi,
I got this error and donno know how to fix it:
In file included from ../except.h:53,
from group.c:22:
.../portspecs.h:81: error: conflicting types for `const double
__infinity'
/usr/include/math.h:26: error: previous declaration as `const __dmath
__infinity'
|
by: Thiru |
last post by:
I am writing an application that interacts with Oracle and Teradata.
In order to create the executable, I need to link various Oracle and
Teradata libraries. I found out that when I link the Oracle and
Teradata libraries together, the Teradata API functions are not
working properly. My assumption is that these libraries are sharing
identical function names and parameter lists and hence the conflicts
are causing the problem. Is my...
|
by: Alexander Gorshenev |
last post by:
I am looking for an elegant solution for the following problem:
I have two projects for which I have to create a kind of bridge
or translator between. For each of the projects there exist a set of headers
included by practicaly all of the member .c files.
For my bridge I would be using all those "main" headers from
both of the projects included together.
But unfortunately, due to historical reasons, those headers
conflict in many...
|
by: Lathe_Biosas |
last post by:
Hi
While compiling my application that needs "windows.h" there are some
typedef redefinition errors
redefinition at winnt.h( line 207) typedef void *HANDLE
redefinition at windef.h( line 143) typedef unsigned char BYTE
redefinition at windef.h( line 141) typedef unsigned long DWORD
#define INVALID_HANDLE_VALUE -1 redefinition at winbase.h(55) #define
| |
by: Will |
last post by:
I've included both the System.Drawing namespance and the
System.Web.UI.WebControls namespace on my page. Both of
these have an Image class, so when I call the Image class
(refering to the System.Drawing namespace) can I do it
without having to write the entire string?
System.Drawing.Image... I get errors saying Image is
ambiguous otherwise.
|
by: dickinsm |
last post by:
Here's an example of a problem that I've recently come up against for
the umpteenth time. It's not difficult to solve, but my previous
solutions have never seemed quite right, so I'm writing to ask whether
others have encountered this problem, and if so what solutions they've
come up with.
Suppose you're writing a class "Rational" for rational numbers. The
__init__ function of such a class has two quite different roles to
play. ...
|
by: helraizer1 |
last post by:
Hi folks,
I have an image based shoutbox which I am currently implementing emoticons onto. I have a way now for the emoticons to appear where the :D or =) etc. is on the image, but for some reason they seem to be conflicting. I shall try to explain.
chatbox.php - only necessary code shown
$grins = array('=D', "=d", ":d", ":D");
foreach ($grins as $grin) {
|
by: Michael.Z |
last post by:
Anyone who can help:
Given a Table.h file I am writing a Table.c file.
I keep getting the compile error:
previous declaration of Table was here / conflicting types for
I think the problem was the result of two pieces of code.
First: typedef struct Table; /* in Table.c*/
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |