C# components for script
Hi, I have written c# components to be used by Python. I note that those components need to be placed in the Pythonnet installation directory because its like private assemblies being loaded. Is there a way I can place them in separate location? Thanks & regards, Mandeep Singh Equity IT
Credit Suisse Tel: (+65) 6212 8755
============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ==============================================================================
Hi, you can place them in your AppDir, i did so. Maybe somewhere else, perhaps in your dll path, but I dont know. Try it. Singh, Mandeep schrieb:
Hi, I have written c# components to be used by Python. I note that those components need to be placed in the Pythonnet installation directory because its like private assemblies being loaded. Is there a way I can place them in separate location?
Thanks & regards, /Mandeep Singh**/****** *Equity IT* *Credit Suisse* Tel: (+65) 6212 8755
============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ==============================================================================
------------------------------------------------------------------------
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet
Hi, sorry, my Fault. My dll ist also in my Pythonnet dir. Sandro Hardy schrieb:
Hi,
you can place them in your AppDir, i did so. Maybe somewhere else, perhaps in your dll path, but I dont know. Try it.
Singh, Mandeep schrieb:
Hi, I have written c# components to be used by Python. I note that those components need to be placed in the Pythonnet installation directory because its like private assemblies being loaded. Is there a way I can place them in separate location?
Thanks & regards, /Mandeep Singh**/****** *Equity IT* *Credit Suisse* Tel: (+65) 6212 8755
==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ==============================================================================
------------------------------------------------------------------------
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet
Hi, it works like I wrote in my first mail. Tried it now. So put your dll in your App-Dir. Sandro Hardy schrieb:
Hi,
sorry, my Fault. My dll ist also in my Pythonnet dir.
Sandro Hardy schrieb:
Hi,
you can place them in your AppDir, i did so. Maybe somewhere else, perhaps in your dll path, but I dont know. Try it.
Singh, Mandeep schrieb:
Hi, I have written c# components to be used by Python. I note that those components need to be placed in the Pythonnet installation directory because its like private assemblies being loaded. Is there a way I can place them in separate location?
Thanks & regards, /Mandeep Singh**/****** *Equity IT* *Credit Suisse* Tel: (+65) 6212 8755
==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ==============================================================================
------------------------------------------------------------------------
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet
Mandeep, You have 2 options. * You can use LoadFrom to load the dll from a particular location import clr import System System.Reflection.Assembly.LoadFrom("your.DLL") * If your DLL and Namespace have the same name python.net should be able to find the dll in the PYTHONPATH Maksim Singh, Mandeep schrieb:
Hi, I have written c# components to be used by Python. I note that those components need to be placed in the Pythonnet installation directory because its like private assemblies being loaded. Is there a way I can place them in separate location?
Thanks & regards, /Mandeep Singh**/****** *Equity IT* *Credit Suisse* Tel: (+65) 6212 8755
============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ==============================================================================
------------------------------------------------------------------------
Yes, they can be anywhere, you just need to write some code to add them to the SYSTEM path for the current running code. Optionally, you can also tell .NET where to look for the assembly's config file. import sys import clr import System loadDir = 'C:/myAssemblyPath/' assemblyName = 'myDLL.dll' configfileName = 'myDLL.ini' # add to system path if not loadDir in sys.path: sys.path.insert(0, loadDir) # tell .NET where to look for the applications config file System.AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", (loadDir + configfileName)) # load it up clr.AddReference(assemblyName) Cheers, Brett From: pythondotnet-bounces+btribble=maxis.com@python.org [mailto:pythondotnet-bounces+btribble=maxis.com@python.org] On Behalf Of Singh, Mandeep Sent: Monday, November 10, 2008 7:56 PM To: pythondotnet@python.org Subject: [Python.NET] C# components for script Hi, I have written c# components to be used by Python. I note that those components need to be placed in the Pythonnet installation directory because its like private assemblies being loaded. Is there a way I can place them in separate location? Thanks & regards, Mandeep Singh Equity IT Credit Suisse Tel: (+65) 6212 8755 ============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ==============================================================================
participants (4)
-
Maksim Kozyarchuk -
Sandro Hardy -
Singh, Mandeep -
Tribble, Brett