HighTechTalks DotNet Forums  

RE: Class.FromType ignores assembly information

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss RE: Class.FromType ignores assembly information in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default RE: Class.FromType ignores assembly information - 09-07-2004 , 07:38 AM






Hello Greg,
This is a bug in VJ# and will be fixed in next release if any. Thanks for
reporting it.
At this point no workaround is known.

Thanks,
Gopi Krishna
VJ#.NET Product team.

--------------------
Quote:
Thread-Topic: Class.FromType ignores assembly information
thread-index: AcSRBuiW7pw9/HvsQ+KnSJCNPxWy5Q==
X-WBNR-Posting-Host: 168.230.33.10
From: "=?Utf-8?B?R3JlZ0w=?=" <GregL (AT) discussions (DOT) microsoft.com
Subject: Class.FromType ignores assembly information
Date: Thu, 2 Sep 2004 09:07:13 -0700
Lines: 18
Message-ID: <1AD6715D-DEE9-432C-B057-B67BF2B048E8 (AT) microsoft (DOT) com
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.vjsharp
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.vjsharp:6437
X-Tomcat-NG: microsoft.public.dotnet.vjsharp

If I execute the following code -

Assembly a1 = Assembly.LoadFrom("c:\\classLoader\\test\\classx.d ll");
Type type1 = a1.GetType("temp.Classx");
Class cl1 = Class.FromType(type1);
Assembly a2 = Assembly.LoadFrom("c:\\classLoader\\test\\testx.dl l");
Type type2 = a2.GetType("temp.Classx");
Class cl2 = Class.FromType(type2);

I would expect that cl2 is the temp.Classx in assembly a2. However, if I
inspect the __corType.Assembly for cl2, it references assembly a1, even
though type2 correctly references assembly a2.

It appears that Class.FromType looks for the first loaded class with the
matching type, regardless of the assembly reference in the Type class
being
passed as an argument.

Is there an alternative (that works) approach to accessing the correct
Class?



Reply With Quote
Reply




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 On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.