Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > .NET Framework

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-08-2008, 03:45 PM
aimlab08@gmail.com
 
Posts: n/a
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
Reply With Quote
  #2 (permalink)  
Old 07-08-2008, 04:16 PM
Jeroen Mostert
 
Posts: n/a
Re: Is that possible to call .net 2.0 com component fro .net 1.1application?

aimlab08@gmail.com wrote:
> 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.
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > .NET Framework


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:57 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Books | Mortgage | Software sale | The eBay Song | Loans



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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109