J
Jim Butler
I am building a utility that will peruse a directory and
will update db tables that will house information about
all of our assemblies. It works fine except for this
error when i use either Assembly LoadFrom/LoadFile for
dll's that don't have all their dependent files listed in
that particular directory (this is true for our gac
files). The information i want to collect is name,
version, class, basetype, refname, refversion (stored in
multiple tables). Is there a way to get the info other
than loading the assembly. I noticed that ildasm has no
problem getting the info from the metadata or is there an
easier way of doing this?
sample below
Dim a1 As [Assembly] = [Assembly].LoadFile("c:\mydll.dll")
Dim t As Type
' error on line below
For Each t In a1.GetTypes()
Debug.WriteLine(t.FullName & "; " & t.BaseType().ToString)
Next t
Dim a As AssemblyName
For Each a In a1.GetReferencedAssemblies()
Console.WriteLine(a.Name() & "; " & a.Version.ToString)
Next
thanks,
jim
will update db tables that will house information about
all of our assemblies. It works fine except for this
error when i use either Assembly LoadFrom/LoadFile for
dll's that don't have all their dependent files listed in
that particular directory (this is true for our gac
files). The information i want to collect is name,
version, class, basetype, refname, refversion (stored in
multiple tables). Is there a way to get the info other
than loading the assembly. I noticed that ildasm has no
problem getting the info from the metadata or is there an
easier way of doing this?
sample below
Dim a1 As [Assembly] = [Assembly].LoadFile("c:\mydll.dll")
Dim t As Type
' error on line below
For Each t In a1.GetTypes()
Debug.WriteLine(t.FullName & "; " & t.BaseType().ToString)
Next t
Dim a As AssemblyName
For Each a In a1.GetReferencedAssemblies()
Console.WriteLine(a.Name() & "; " & a.Version.ToString)
Next
thanks,
jim