[Python.NET] assemblymanager and reflection only assemblies

Barton barton at bcdesignswell.com
Sun Nov 4 23:44:41 CET 2012


Interesting. I'm planning on having some time freed up for this project 
and I'll take a look and run unit testing on your suggestion.
Thanks.

On 10/26/2012 07:38 PM, brad at fie.us wrote:
> fyi:  I ran into a bug and fixed it… I think?
>
> Some thoughts on what I did?
>
> I am writing an application that loads plugins.  As part of that, it first loads the plugin assembly in "reflection only" mode.
>
> pythonnet's assemblymanager.cs registers a handler at line 54.
>
> it gets called when I load the assembly… even in reflection mode.  Which I think is correct.
>
> the handler begins at line 88.
>
> it was throwing an exception when it tries to "ScanAssembly()" on the passed assembly.  More specifically when it tried to load the types.
>
> If I'm reading the code right, it should not attempt to scan the assembly because it is loaded reflection only.  One can check this with the "ReflectionOnly" property of the provided assembly.  So I surrounded the rest of the code in a "if" conditional and only add the assembly and scan it, if it is not "RefelctionOnly."
>
> Is that the right thing to do?  It's gotten rid of my problem.  But I wonder if its strictly correct to both not add it to the assemblies collection in the manager and also not scan it.
>
> Thoughts?  I don't want to submit a patch if it's not really the right approach to the matter.
> _________________________________________________
> Python.NET mailing list - PythonDotNet at python.org
> http://mail.python.org/mailman/listinfo/pythondotnet
>


More information about the PythonDotNet mailing list