I'm trying to use dblinq in my IronPython application but am having some problems getting started. When trying to import dblinq classes,using clr.AddReference() it does not seem to see dblinq.
I can build but not access the library
import clr
clr.AddReference("DbLinq")
clr.AddReference("System.Data.Linq")
from System.Data.Linq import DataContext
exit = raw_input("press any key to quit")
1: My dblinq source is in a subfolder called Resources
clr.AddReferenceToFileAndPath("Resources/DbLinq.dll") => file not found
clr.AddReference("DbLinq") => could not add reference to dblinq
clr.AddReferenceToFileAndPath("C:/Development/DBLinq2/Dblinq.dll" => success
but still cannot use the classes using from DbLinq import ...
Solution
import clr
clr.AddReferenceToFileAndPath("%s\Resources\DbLinq.dll" %os.getcwd())
clr.AddReference("DbLinq")
from Npgsql import *
from DbLinq import Data
Dependency Walker(dependencywalker.com) on DbLinq.dll to see if that yields something interesting... - ChristopheDResources/DbLinq.dll(you should) orC:\Development\DBLinq2...(that directory might contain other dll's which are needed in theResourcedirectory) - ChristopheDimport sys sys.path.append(r"C:\Temp\DbLinq-0.20.1")- Simon Opeltclr.AddReference("DbLinq")- Simon Opelt