I recompiled using .NET 2.0 and now I can load the DLL. Is there any support for frameworks after 2.0? I'd hate to lose the ability to use LINQ.<br><br>Also, you mentioned Python.Runtime.dll.config. I don't have this file. What's in it?<br>
<br>thanks for your help<br><br><div class="gmail_quote">On Tue, Dec 14, 2010 at 8:06 PM, Laszlo Sebo <span dir="ltr"><<a href="mailto:laszlo.sebo@primefocusworld.com">laszlo.sebo@primefocusworld.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">When you import the assembly it will be referenced by the assembly name defined in the project settings (which is what the dll will be named as). GAC isn't required ( i never do that ).<br>
<br>
I just did a quick test here. Made an empty Class project via Visual Studio 2008.<br>
<br>
Then tweaked the source to add 2 functions:<br>
<br>
using System;<br>
using System.Collections.Generic;<br>
using System.Linq;<br>
using System.Text;<br>
<br>
namespace ClassLibrary1<br>
{<br>
public class Class1<br>
{<br>
public string Function1()<br>
{<br>
return "Test Function Called";<br>
}<br>
public void Function2()<br>
{<br>
Console.WriteLine("Hello World");<br>
}<br>
}<br>
}<br>
<br>
I built it with all default settings (as a class library), then copied the dll to the python / lib / site-packages folder, along with the clr.pyd, Python.Runtime.dll and Python.Runtime.dll.config files<br>
<br>
Then from python:<br>
<br>
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel<br>
win32<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
>>> import clr<br>
>>> clr.AddReference('ClassLibrary1')<br>
<System.Reflection.Assembly object at 0x01DF5580><br>
>>> import ClassLibrary1<br>
>>> myObject = ClassLibrary1.Class1()<br>
>>> myObject.Function1()<br>
u'Test Function Called'<br>
>>> myObject.Function2()<br>
Hello World<br>
>>><br>
<br>
Note that the "import ClassLibrary1" is the namespace not the assembly (it just happens to be the same since its all default values).<br>
I wonder if your issue is somehow related to VS2010? Could it be adding some default references? What references are listed in VS?<br>
<br>
<br>
cheers,<br><font color="#888888">
laszlo</font><div class="im"><br>
<br>
<br>
<br>
On 14/12/2010 5:47 PM, Jason Awbrey wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Thanks. I tried creating a test assembly with just a default constructor and no other dependencies, and I get the same error when I try to import it.<br>
<br>
I also tried setting the path variable, through windows as well as in code, and get the same result.<br>
<br>
Assuming my dll is named "TestLib.dll", I should be able to do clr.AddReference("TestLib"), correct?<br>
<br>
Do I have to strong name my assemblies, or put them in the GAC? Or is that optional?<br>
<br>
Any other suggestions of how to track this down?<br>
</blockquote>
<br></div><div><div></div><div class="h5">
_________________________________________________<br>
Python.NET mailing list - <a href="mailto:PythonDotNet@python.org" target="_blank">PythonDotNet@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">http://mail.python.org/mailman/listinfo/pythondotnet</a><br>
</div></div></blockquote></div><br>