Does this mean that the fact that mentioned .dll is in their Csharp folder, does not necessarily mean it’s a .NET assembly? Is there a way I could check if an assembly is a .NET or not?
A managed DLL / Application will have a primary dependency on MSCOREE.DLL. So, if you open the DLL, RHP, etc., in Dependency Walker you have no problems in telling a managed library from an unmanaged one.
Understood.
I tried opening a different .dll from the same folder: gdal_csharp.dll (attached below). When I open it in Dependency Walker, it has a primary dependency to MSCOREE.DLL.
However it does not allow to be imported. It raises: “No module named gdal_csharp” on the last line:
from clr import AddReferenceToFileAndPath as addref
addref("c:/gdal/gdal_sharp.dll")
importedAssembly = "gdal_csharp" in [assembly.GetName().Name for assembly in clr.References]
print "importedAssembly: ", importedAssembly # prints: True
import gdal_csharp as gdalcs
I am familiar with calling methods from an assembly.
Was just puzzled why upper one was not able to imported. Looks like I needed to use “import OSGeo.GDAL as gdalcs” instead.
I hope the autocomplete of available namespaces from loaded assembly will be added to Rhino 6.