ok. i just want If I say imports System I should get the assembly system.dll this itself is not working?? the code u sent works for somecases like "System.Reflection.PropertyInfo" which gives mscorb what do for the cases like system...
pls help. regard george --- Mitch Denny <[EMAIL PROTECTED]> wrote: > George, > > There is no easy way to solve the problem because > other than > what is in the GAC .NET doesn't know where to find > assemblies > other than where you tell it to. The way the ASP.NET > team > tackled this was introduce @ Import directives at > the top of > *.aspx (and whatever) files. The other thing that > did was set > asside a special directory /bin where the developer > would > need to insert all the assemblies into. > > If you don't want to take this approach (/bin > directory) you > will need to brute force search every assembly on > the machine > to find the assembly you are after. This just isn't > practical > and that is before you even start to consider > dealing with > version conflicts. > > I'm sorry George, .NET is not a scripting > environment, you > can get it to behave like one for gee-whiz effect > but its > not really a business solution. Even VSA requires > the developer > to provide assembly references. > > ---------------------------------------- > - Mitch Denny > - [EMAIL PROTECTED] > - +61 (414) 610-141 > - > > -----Original Message----- > From: The DOTNET list will be retired 7/1/02 > [mailto:[EMAIL PROTECTED]] On Behalf Of > george antony > Sent: Wednesday, 19 June 2002 16:20 > To: [EMAIL PROTECTED] > Subject: Re: [DOTNET] Interesting Problem, what am I > missing (WAS: > Urgent pls -finding the assembly name from > namespace). > > > hi > > Thanks for the code. The problem is > I am using system.ComponentModel.component > the reference type is nothing .. > how will i get the assembly name for this.. > > > my requirement is like this > if the user says imports Microsoft.Biztalk.btsconfig > > I have to find the assembly name from the > microsoft.biztalk.btsconfig > and i should add the assembly name to the .net > script engine > > What will i do if the reference type is nothing > > regards > gan > > --- Mitch Denny <[EMAIL PROTECTED]> wrote: > > Hi all/George, > > > > Below is the code that I would have converted my > C# > > sample into, > > however George is quite correct, it doesn't seem > to > > be working > > at all. When executed, if it all works it should > > return a message > > box giving the full assembly name for System.dll > but > > it doesn't. > > > > Probably best to read the code now so you know > what > > I am jabbering > > on about: > > > > Imports FindAsmVB > > Imports System > > Imports System.ComponentModel > > Imports System.Reflection > > Imports System.Windows > > Imports System.Windows.Forms > > > > Namespace FindAsmVB > > > > Public Class EntryPoint > > > > Public Shared Sub Main() > > > > ' Declare locals. > > Dim typeToFind As String > > Dim typeReference As Type > > > > ' Try and find type. > > typeToFind = > > "System.ComponentModel.Component" > > typeReference = > Type.GetType(typeToFind, > > False, True) > > If (typeReference Is Nothing) Then > > > > MessageBox.Show( _ > > String.Format( _ > > "Could not find type: {0} > in > > loaded > > assemblies.", _ > > typeToFind _ > > ) _ > > ) > > > > Else > > > > MessageBox.Show( _ > > String.Format( _ > > "Found type: {0} in > > assembly: {1}.", _ > > typeReference.FullName, _ > > > > typeReference.Assembly.FullName _ > > ) _ > > ) > > > > > > Trace.WriteLine(typeReference.Assembly.FullName) > > > > End If > > > > End Sub > > > > End Class > > > > End Namespace > > > > I thought that perhaps the System.dll assembly > > wasn't > > getting loaded because I don't really need it, so > I > > inserted this diagnostic code up the top: > > > > Trace.Indent() > > > > Dim assm As System.Reflection.Assembly > > For Each assm In > > AppDomain.CurrentDomain.GetAssemblies() > > > > > > Trace.WriteLine(String.Format("Assembly: {0}", > > assm.FullName)) > > > > Trace.Indent() > > > > Dim modu As > System.Reflection.Module > > For Each modu in assm.GetModules() > > > > > > Trace.WriteLine(String.Format("Module: {0}", > > modu.Name)) > > > > Next > > > > Trace.Unindent() > > > > Next > > > > Trace.Unindent() > > > > The output clearly shows that the System.dll > > assembly > > is being loaded: > > > > Assembly: mscorlib, Version=1.0.3300.0, > > Culture=neutral, > > PublicKeyToken=b77a5c561934e089 > > Module: mscorlib.dll > > Assembly: FindAsmVB, Version=1.0.900.29656, > Culture=neutral, > > PublicKeyToken=null > > Module: FindAsmVB.exe > > Assembly: System, Version=1.0.3300.0, > > Culture=neutral, > > PublicKeyToken=b77a5c561934e089 > > Module: system.dll > === message truncated === __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.