I created a Class Library project in Visual Studio 2010 and created added the following VB.Net class:
Public Class Dumb
Private name As String
Public Sub New(ByVal newName As String)
name = newName
End Sub
Public Sub sayHi()
System.Console.WriteLine("Hi " & name)
End Sub
End Class
I built the solution and generated a DLL file (say PATH_TO_NEW_DLL).
In IronPython, I get the error below when I try to clr.AddReferenceToFileAndPath(PATH_TO_NEW_DLL). The file DOES exist on my computer.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: System.IO.IOException: file does not exist: [PATH_TO_NEW_DLL]
at IronPython.Runtime.ClrModule.AddReferenceToFileAndPath(CodeContext context, String file)
at IronPython.Runtime.ClrModule.AddReferenceToFileAndPath(CodeContext context, String[] files)
at Microsoft.Scripting.Utils.ActionHelper`2.Invoke(Object arg0, Object arg1)
at Microsoft.Scripting.Utils.ReflectedCaller.Invoke(Object[] args)
at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args, Boolean& shouldOptimize)
at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(CallSite site, CodeContext context, TFuncType func, T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at <unnamed>$28.<unnamed>(CodeContext $globalContext, FunctionCode functionCode) in <stdin>:line 1
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at IronPython.Compiler.PythonScriptCode.Run(Scope scope)
at IronPython.Hosting.PythonCommandLine.<>c__DisplayClass1.<RunOneInteraction>b__0()