View Full Version : Running DLL from other machines
2008-02-21, 11:09 PM
I've created a nice .dll external command that works fine on my development box but won't even try and run on any other machine. I copied the revit.ini text directly from my machine and pasted it into the new machine. Should be no errors there. There is a message box right in the beginning that does not appear. I'm using SharpDevelop. Is there some security issue I need to address? The .dll has been moved to a shared network location with the same pathing conventions. That is the correct method of distributing these files isn't it?
2008-02-21, 11:31 PM
I double checked the permissions. RWX on the directory and the file (linux server here) for all users.
When I moved the .dll to a directory on the local c: drive, it worked! But it works on a network drive from my machine.
2008-02-22, 06:36 PM
You're correct, this is a security issue. The solution is to push out security settings to the other machines.
In the fourth post here (http://discussion.autodesk.com/thread.jspa?threadID=518445), the steps are defined to set the security for the machine. The poster suggests using a batch file to copy this policy to other machines. He also suggests putting your new group under "All_Code", but I would suggest putting it under the "LocalIntranet_Zone", ie your local network.
You can also create an MSI file (http://msdn2.microsoft.com/en-us/library/13wcxx6y(VS.80).aspx)that you can 'install' on other machines to add the security policy. Either method could be pushed out to all machines via login script, group policy, or SMS.
This one tripped me up for a long time before I found a solution for it.
FWIW, the official line is to put commands in the program directory for the version of Revit required. There are some reasons for doing this, and some good reasons not too IMO. There is an aspect to the API I have spent some time debugging and documenting solutions for. I'll be posting about this soon.
Regardless if you want to have commands on the network they need to run as fulltrust.
2008-02-22, 10:20 PM
Good point, and I'm actually doing this with my AutoCAD customization. I wrote a 'loader' app that copies the files locally from a central location, then loads them on demand. In that way, you have the advantage of local copy speed and security with the ability to update with the latest files. You could do a similar thing with Revit's OnOpen event.
There are some really good .NET/ RevitAPI reasons to consider this carefully. I've spent too much frigging time debugging an issue that lead to a lot of discussion with ADN. Sorry to be obtuse, I'll discuss it in full soon enough. I want to enjoy the solution a while and work out the best way forward before making it public. Needless to say, the fundamental limitation of the current API approach (shared by AutoCAD btw) means there really isn't a perfect solution.
Cache locally is one solution , OnLoad is too late in the cycle, the loader has already created the commands from the loaded dll's.
2008-02-23, 01:53 AM
Is there a perfect solution to any software development? ;-) I look forward to seeing what you've got...
Powered by vBulletin® Version 4.1.11 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.