qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rupert Smith (JIRA)" <qpid-...@incubator.apache.org>
Subject [jira] Commented: (QPID-239) Use of assembly name vs. assembly path in AMQConnection.LoadTransportFromAssembly()
Date Fri, 05 Jan 2007 14:59:27 GMT

    [ https://issues.apache.org/jira/browse/QPID-239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462493
] 

Rupert Smith commented on QPID-239:
-----------------------------------

Looks like the transport is being loaded dynamically, presumably so that different transports
can be substituted. LoadFrom seems to be the wrong thing to do here though, given Tomas' comments
and the points made in the above links, as presumably the transport (or variety of transports...)
will be available at compile time and statically linkable.

Here's a patch. I left the original code commented out.

> Use of assembly name vs. assembly path in AMQConnection.LoadTransportFromAssembly()
> -----------------------------------------------------------------------------------
>
>                 Key: QPID-239
>                 URL: https://issues.apache.org/jira/browse/QPID-239
>             Project: Qpid
>          Issue Type: Bug
>          Components: Dot Net Client
>         Environment: .NET 1.1 and 2.0
>            Reporter: Tomas Restrepo
>            Priority: Minor
>
> The third argument to AMQConnection.LoadTransportFromAssembly() is called "assemblyName",
suggesting that it should contain a partially or fully qualified assembly name. 
> However, the argument value is actually used as an argument to Assembly.LoadFrom(), which
doesn't take an assembly name but an assembly path instead. The two are at odds with each
other.
> So, either the argument name is wrong (and it should be assemblyFilename instead) or
the call to Assembly.LoadFrom() should be replaced with a call to Assembly.Load() instead.
Which one is the correct fix will depend on what the original intentions of the code are and
the expected usage.
> However, in general terms I'd recommend avoiding Assembly.LoadFrom() and use Assembly.Load()
instead to allow the runtime to do proper assembly loading resolution (including loading from
the GAC if necessary) and avoiding conflicts because of load contexts (Load() and LoadFrom()
load assemblies in different binding contexts which affects how dependencies are resolved
and loaded at runtime. Check out http://blogs.msdn.com/suzcook/archive/2003/05/29/57143.aspx
and http://www.gotdotnet.com/team/clr/LoadFromIsolation.aspx for the details of this).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message