Re: Using assembly.load to load system.data

From: Dan (daniel_at_hawkins1978.fsnet.co.uk)
Date: 03/03/05


Date: Thu, 3 Mar 2005 12:09:31 -0000

Hi Sergey

The code in the catch block trys to load with the fullname, but looking at
what you said I had a different publickeytoken, that might have been the
problem.

Thanks
Dan
"Sergey Bogdanov" <sergey.bogdanov@gmail.com> wrote in message
news:%23xnQs19HFHA.1528@TK2MSFTNGP09.phx.gbl...
> How do you invoke it? Try something like this:
> loadAssembly("System.Data", "System.Data, Version=1.0.5000.0,
> Culture=neutral, PublicKeyToken=969db8053d3322ac")
>
> Best regards,
> Sergey Bogdanov
> http://www.sergeybogdanov.com
>
>
> Dan wrote:
>> Hi Daniel
>> The code I use is this:
>>
>> Public Shared Sub loadAssembly(ByVal ns As String, ByVal assemblyName
>> As String)
>> Dim ass As [Assembly]
>> If Not assemblyMappings.ContainsKey(ns) Then
>> Try
>> ass = [Assembly].Load(ns)
>> assemblyMappings(ns) = ass
>> Catch ex As Exception
>> If ass Is Nothing Then
>> 'try load from fullname
>> ass = [Assembly].Load(assemblyName)
>> assemblyMappings(ns) = ass
>> End If
>> End Try
>> End If
>> End Sub
>>
>> So if I call this to load system.data, ns would be system.data and
>> assembly name is the full name, version, public key etc. But even when
>> trying to load it with the fullname fails.
>>
>> Thanks
>> Dan
>> "Daniel Moth" <dmoth74@hotmail.com> wrote in message
>> news:e4CLV$3HFHA.1172@TK2MSFTNGP12.phx.gbl...
>>
>>>Can you show some code?
>>>
>>>Chances are that you are not passing the full name to Assembly.Load. If
>>>that is the case, the only reason winforms & drawing loaded was because
>>>they were loaded already. To test this theory insert this line just
>>>before your Assembly.load of system.data. If it works with and doesn't
>>>without, it is as I suspected so share some code. If it continues to
>>>throw then... ...still show us the code
>>>
>>>// c#
>>>System.Data.Column b = new System.Data.Column("test")
>>>
>>>' vb
>>>Dim b As New System.Data.DataColumn("test")
>>>
>>>Cheers
>>>Daniel
>>>--
>>>http://www.danielmoth.com/Blog/
>>>
>>>
>>>"Dan" <daniel@hawkins1978.fsnet.co.uk> wrote in message
>>>news:ukjRj6qGFHA.2524@TK2MSFTNGP15.phx.gbl...
>>>
>>>>Hi everyone
>>>>I'm having trouble trying to load the system.data assembly.
>>>>If I do assembly.load() and pass in system.windows.forms or
>>>>system.drawing
>>>>it loads the assembly but if I use system.data it throws an ioexception.
>>>>
>>>>has anyone else come across this
>>>>thanks
>>>>Dan
>>>>
>>>
>>



Relevant Pages

  • Re: Using assembly.load to load system.data
    ... >> Public Shared Sub loadAssembly(ByVal ns As String, ByVal assemblyName As ... >> 'try load from fullname ... >> trying to load it with the fullname fails. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Detect if assembly exists
    ... I'd like to know if an assembly exists in the GAC or directory, and therefore can be loaded if required. ... The only thing I know about the assembly is it's fullname like the AssemblyName.FullName property. ... I found out I could try to load the assembly with Assembly.Loadand catch the FileNotFoundException, but this would also load the assembly if it exists. ... Prev by Date: ...
    (microsoft.public.dotnet.framework.clr)
  • Re: Detect if assembly exists
    ... Unfortunately AFAIK the only way to really tell is to actually load the ... Loading it into another appdomain does work and it's not particularly nasty, ... bits without unloading the appdomain. ... > How do I determine if an assembly (by it's fullname) exists in a proper ...
    (microsoft.public.dotnet.framework.clr)
  • Re: zipimport
    ... > I tried to load submodule.submodule1 using this pice of code: ... "'fullname' must be the fully qualified module name.". ... part of that doesn't seem to be correct, at least with the version of python ...
    (comp.lang.python)
  • Re: VBA macro stops executing on Word 2003 but works on Word XP
    ... The macro executes perfectly. ... Dim PatFullName() As String ... ' Load Provider Name into ProvPath var ...
    (microsoft.public.word.vba.general)

Loading