[Python.NET] importing Assembly

Geraint Williams gerainthuwwilliams at hotmail.com
Wed Feb 25 03:12:51 EST 2004


Hi, thanks for the response but have already solved the problem.
The Assembly (which I had copied to the python dir) referenced another 
assembly (which I had not - although I think I may have been included in my 
path).  Copying the referenced assembly to my python dir did the trick.

Anyway, thanks for the product... has made my life (testing a .NET assembly) 
far easier.  Find it far more productive writing test scripts in a scripting 
language than in C# development environment.

Cheers,
Geraint.



>From: "Brian Lloyd" <brian at zope.com>
>To: "Geraint Williams" 
><gerainthuwwilliams at hotmail.com>,<pythondotnet at python.org>
>Subject: RE: [Python.NET] importing Assembly
>Date: Tue, 24 Feb 2004 22:00:53 -0500
>
> > I see that this has been asked before, but I must be missing something
> >
> > >>>import CLR.Company.Product.Module
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> > ImportError: No module named Company
> >
> > The dll I have is called:  "Company.Product.Module.dll", and is
> > copied into
> > the python root dir
> >
> > The source code for the module defines namespace as "namespace
> > Company.Product.Module"
> >
> > Also I try the following:
> >
> > >>>from CLR.System.Reflection import Assembly
> > >>>a = Assembly.LoadWithPartialName('Company.Product.Module')
> > >>>import CLR.Company.Product.Module
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> > ImportError: No module named Company
> >
> > please excuse any obvious ignorance of .NET terminology, it's
> > something I've
> > just started looking at.
>
>Sorry I'm late on this - my spam filter starting eating some
>of my mailing list email a week or so ago and I'm still catching
>up :(
>
>I'm curious whether you can use reflection to loop over the types
>defined in your assembly after using LoadWithPartialName to load
>it. What you are doing looks like it _should_ work fine.
>
>Brian Lloyd        brian at zope.com
>V.P. Engineering   540.361.1716
>Zope Corporation   http://www.zope.com
>
>

_________________________________________________________________
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo




More information about the PythonDotNet mailing list