<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-2">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Ahh, you need to drop the &#8220;\bar.dll&#8221; from the path &#8211;
it should just be the directory where bar.dll lives.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> users-bounces@lists.ironpython.com
[mailto:users-bounces@lists.ironpython.com] <b>On Behalf Of </b>Lukas Cenovsky<br>
<b>Sent:</b> Thursday, May 20, 2010 12:39 PM<br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Add reference to .dll located in above
directory<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Dino Viehland wrote: <o:p></o:p></p>

<pre>Lukáš wrote:<o:p></o:p></pre><pre>  <o:p></o:p></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>Yes, the above works for me too, but the following one does not:<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>F:\Product\1\Dlr\x\module &gt; ipy foo.py<o:p></o:p></pre><pre>    <o:p></o:p></pre></blockquote>

<pre><o:p>&nbsp;</o:p></pre><pre>Even with the full path added to sys.path instead of the relative <o:p></o:p></pre><pre>path?  Because this one works for me as well.<o:p></o:p></pre><pre>  <o:p></o:p></pre>

<p class=MsoNormal><br>
This is strange. It does not work for me even with the full path.<br>
I run it on IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.4927 on Win7
64-bit<br>
<br>
Directory of M:\root<br>
<br>
20.05.2010&nbsp; 21:29&nbsp;&nbsp;&nbsp;
&lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
20.05.2010&nbsp; 21:29&nbsp;&nbsp;&nbsp;
&lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..<br>
19.03.2010&nbsp;
11:15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
34&nbsp;648 ipy.exe<br>
19.03.2010&nbsp; 11:15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1&nbsp;496&nbsp;920 IronPython.dll<br>
19.03.2010&nbsp;
11:15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 464&nbsp;728
IronPython.Modules.dll<br>
19.03.2010&nbsp;
11:15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 956&nbsp;248
Microsoft.Dynamic.dll<br>
19.03.2010&nbsp;
11:15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 403&nbsp;288
Microsoft.Scripting.Core.dll<br>
19.03.2010&nbsp;
11:15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
58&nbsp;200 Microsoft.Scripting.Debugging.dll<br>
19.03.2010&nbsp;
11:15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 178&nbsp;008
Microsoft.Scripting.dll<br>
19.03.2010&nbsp;
11:15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
11&nbsp;096 Microsoft.Scripting.ExtensionAttribute.dll<br>
20.05.2010&nbsp; 21:29&nbsp;&nbsp;&nbsp;
&lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
8 File(s)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;603&nbsp;136 bytes<br>
<br>
&nbsp;Directory of M:\root\test<br>
<br>
20.05.2010&nbsp; 21:29&nbsp;&nbsp;&nbsp;
&lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
20.05.2010&nbsp; 21:29&nbsp;&nbsp;&nbsp;
&lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..<br>
20.05.2010&nbsp;
21:20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
4&nbsp;608 bar.dll<br>
20.05.2010&nbsp; 21:29&nbsp;&nbsp;&nbsp;
&lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; module<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1 File(s)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;608
bytes<br>
<br>
&nbsp;Directory of M:\root\test\module<br>
<br>
20.05.2010&nbsp; 21:29&nbsp;&nbsp;&nbsp;
&lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
20.05.2010&nbsp; 21:29&nbsp;&nbsp;&nbsp;
&lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..<br>
20.05.2010&nbsp;
21:21&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
128 foo.py<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1 File(s)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 128
bytes<br>
<br>
foo.py contains:<br>
<br>
import clr<br>
import sys<br>
sys.path.append(r'M:\root\test\bar.dll')<br>
clr.AddReference('bar')<br>
import bar<br>
print 'oki'<br>
<br>
bar.py contains:<br>
<br>
print 'from bar'<br>
<br>
<br>
M:\root\test&gt;M:\root\ipy.exe module\foo.py<br>
from bar<br>
oki<br>
<br>
M:\root\test\module&gt;M:\root\ipy.exe foo.py<br>
Traceback (most recent call last):<br>
&nbsp; File &quot;foo.py&quot;, line 4, in &lt;module&gt;<br>
IOError: System.IO.IOException: Could not add reference to assembly bar<br>
&nbsp;&nbsp; at
Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args,
Boolean&amp; shouldOptimize)<br>
&nbsp;&nbsp; at
IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(CallSite
site, CodeContext context, TFuncType func, T0 arg0)<br>
&nbsp;&nbsp; at
System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site,
T0 arg0, T1 arg1, T2 arg2)<br>
&nbsp;&nbsp; at
IronPython.Runtime.Types.BuiltinFunction.BuiltinMethodCaller`2.Call1(CallSite
site, CodeContext context, TFuncType func, T0 arg0)<br>
&nbsp;&nbsp; at
IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame
frame)<br>
&nbsp;&nbsp; at
Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)<br>
&nbsp;&nbsp; at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0
arg0)<br>
&nbsp;&nbsp; at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)<br>
&nbsp;&nbsp; at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)<br>
&nbsp;&nbsp; at IronPython.Hosting.PythonCommandLine.RunFileWorker(String
fileName)<br>
&nbsp;&nbsp; at IronPython.Hosting.PythonCommandLine.RunFile(String fileName)<br>
<br>
--<br>
-- Lukáš<o:p></o:p></p>

</div>

</div>

</body>

</html>