Ich versuche clr.AddReference zu verwenden sqlite3 Funktionalität zu einem einfachen Ironpython Programm hinzufügen Ich schreibe; aber jedes Mal wenn ich versuche System.Data.SQLite zu referenzieren bekomme ich diesen Fehler:Hinzufügen System.Data.SQLite Referenz in Ironpython
Traceback (most recent call last): File "", line 1, in IOError: System.IO.IOException: Could not add reference to assembly System.Data.SQLite
at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args, Boolean&shouldOptimize)
at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller2.Call1(CallSite site, CodeContext context, TFuncType func, T0 arg0)
4.Run(InterpretedFrame frame)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at CallSite.Target(Closure , CallSite , CodeContext , Object , Object)
at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Runtime.FunctionCode.Call(CodeContext context)
at IronPython.Runtime.Operations.PythonOps.QualifiedExec(CodeContext context, Object code, PythonDictionary globals, Object locals)
at Microsoft.Scripting.Interpreter.ActionCallInstruction
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
Ich habe vor allem die Importe und Referenzen im Interpreter erproben, und dies sind die Linien I-Test:
import sys
import clr
sys.path.append("C:/Program Files (x86)/SQLite.NET/bin")
clr.AddReference("System.Data.SQLite")
Der Fehler tritt auf, nachdem die Zeile clr.AddReference eingegeben wurde. Wie würde ich System.Data.SQLite richtig hinzufügen?
Ich habe SQLite.NET heruntergeladen, und Ihr Beispielcode funktioniert perfekt für mich. Überprüfen Sie den Pfad zu SQLite korrekt? – Cameron