Name conflicts with multiple .NET versions

  • Thread starter =?ISO-8859-1?Q?Christian_Fr=F6schlin?=
  • Start date

?

=?ISO-8859-1?Q?Christian_Fr=F6schlin?=

I have an assembly "A" which contains a Windows Control and has
been compiled with C# in .NET 1.0, and I have now attempted to use
this from a C++ 2005 Windows Forms Application "B".

I can add a reference to the assembly and add a control to
the form without problems, but when compiling I get a heap
of errors complaining about conflicts between symbols from
differing version of System.Windows.Forms and similar:

c:\winnt\assembly\gac\system.windows.forms\1.0.3300.0__b77a5c561934e089\
system.windows.forms.dll : warning C4945: 'ResXFileRef' :
cannot import symbol from
'c:\winnt\assembly\gac\system.windows.forms\1.0.3300.0__b77a5c561934e089\
system.windows.forms.dll': as 'System::Resources::ResXFileRef' has
already been imported from another assembly 'System.Windows.Forms'
c:\winnt\microsoft.net\framework\v2.0.50727\system.windows.forms.dll :
see declaration of 'System::Resources::ResXFileRef'

Technically, I understand that the compiler has a point here,
because A contains an explicit reference to System.Windows.Forms
in .NET 1.0, while B contains an explicit reference to
System.Windows.Forms in .NET 2.0.

However, there is no problem using A in a C# 2005 or VB.NET 2005
Windows Forms applications, and I would expect enough intelligence
in the .NET runtime to resolve this issue anyway. This seems to
be a special problem of the C++ project type or C++ compiler.

It works without problems if I compile A with .NET 2.0.
My reason for compiling A with .NET 1.0 in the first place was to
have a single assembly which works in all development environments
like .NET 1.0, .NET 2.0 or Mono (the assembly is the "product"),
given that I don't need any of the new features and everything
seems to work fine except for this C++ 2005 glitch.

Any ideas?
 
Ad

Advertisements

?

=?ISO-8859-1?Q?Christian_Fr=F6schlin?=

I have an assembly "A" which contains a Windows Control and has
been compiled with C# in .NET 1.0, and I have now attempted to use
this from a C++ 2005 Windows Forms Application "B".

Did noone else encounter this scenario before? Although the problem
is not related to the C++ language itself, it only seems to manifest
itself with C++ projects in Visual Studio 2005.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top