PDA

View Full Version : Auto Load DLL



bweir
2006-10-19, 02:09 PM
I have created a .Net DLL for AutoCAD. My tools work great. Now how can I make this DLL load automatically when AutoCAD starts? I have tried using LISP with the (command "netload" "....") but this doesn't seem to work from startup. When the LISP tries to load the DLL something like the following message appears:
...Cannot load assembly. Error details: System.IO.FileNotFoundException: Could not load file or assembly...

I'm assuming that I have to enable some sort of security in my DLL project but haven't figured it out yet. Any suggestions?

bweir
2006-10-19, 05:21 PM
I solved it. I needed to add Imports System.Security.Permissions.SecurityPermission to my source and the DLL will load fine.

moon47
2008-09-12, 06:56 PM
I found that all i had to do was put double slashes in my file name...

So instead of:

(command "netload" "C:\Documents and Settings\User\My Documents\Working\Sample\bin\Release\Sample.dll")

It would be:

(command "netload" "C:\\Documents and Settings\\User\\My Documents\\Working\\Sample\\bin\\Release\\Sample.dll")

I know that we are supposed to use the registry to demand load dll's but i like this way much better... It is easier to manage and setup/change then messing with registry entries...

joelkarr
2008-12-01, 03:15 AM
you can autoload the DLL's through editing the registry. There is a great post here

http://through-the-interface.typepad.com/through_the_interface/2006/09/automatic_loadi.html