Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Is that possible to call .net 2.0 com component fro .net 1.1application?

Reply
 
Old 07-08-2008   #1 (permalink)
aimlab08


 
 

Is that possible to call .net 2.0 com component fro .net 1.1application?

Hi all,

We have an application which is created in .net 1.1(Visual studio
2003). Now we need to create maps from this application. The only
chioce for us is to use ESRI libraries to generate map images.

The issue is, current version of ESRI (ArvGIS 9.2) only support .net
2.0. I wrote a map component with Visual studio 2005, and check the
"Register for COM interop" for the project. This creates both dll and
tlb assemblies.

I was not able to add this com component to my .net 2003 application
as reference. When I tried to add the tlb file as the reference, I got
the following error message:

"A reference to "myMapCom" could not be added. Converting the type
library to a .NET assembly failed. Type library myMapCom was exported
from a CLR assembly and can not be re-imported as a CLR assembly."

Any idea for solving this issue?

Thanks.

Linda

My System SpecsSystem Spec
Old 07-08-2008   #2 (permalink)
Jeroen Mostert


 
 

Re: Is that possible to call .net 2.0 com component fro .net 1.1application?

aimlab08@xxxxxx wrote:
Quote:

> We have an application which is created in .net 1.1(Visual studio
> 2003). Now we need to create maps from this application. The only
> chioce for us is to use ESRI libraries to generate map images.
>
> The issue is, current version of ESRI (ArvGIS 9.2) only support .net
> 2.0. I wrote a map component with Visual studio 2005, and check the
> "Register for COM interop" for the project. This creates both dll and
> tlb assemblies.
>
> I was not able to add this com component to my .net 2003 application
> as reference. When I tried to add the tlb file as the reference, I got
> the following error message:
>
> "A reference to "myMapCom" could not be added. Converting the type
> library to a .NET assembly failed. Type library myMapCom was exported
> from a CLR assembly and can not be re-imported as a CLR assembly."
>
> Any idea for solving this issue?
>
First, you absolutely want to consider converting your 1.1 application to
2.0. There's no point clinging to VS 2003 and the 1.1 runtime, especially
since recent Windows installations don't have the 1.1 runtime at all and
simply run 1.1 assemblies in the 2.0 runtime as well (so you might as well
deal with the compatibility issues now). If the argument is that your
clients only have 1.1 installed: in that case, you cannot use 2.0 components
at all, so that would not seem to be an issue.

As you've discovered, direct COM interop between .NET assemblies isn't
supported (because .NET assemblies should call each other directly -- but
VS2003 can't handle 2.0 assemblies). You can use COM+ by deriving your 2.0
component from ServicedComponent and deploying it as a server, but this has
some runtime overhead.

One workaround could be to create a stub 1.1 assembly with empty
implementations and sign it with the same strong name as your 2.0 assembly.
You can then deploy the 2.0 assembly and set up binding redirection in the
app.config to force the runtime to load the new assembly instead. This works
only if the entire application is running under the 2.0 framework, and it
has some obvious maintenance problems. Disclaimer: I haven't tested this.

--
J.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
How to call queued component from VBScript? VB Script
Is that possible to call .net 2.0 com component fro .net 1.1application? .NET General
the ultimate gui component for js/vbs VB Script
ActiveXPowerShell component VB Script
Call function with parameters that also call functions (.Net and P PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46