Running dll from network drive

Running dll from network drive

Anonymous
Not applicable
4,123 Views
2 Replies
Message 1 of 3

Running dll from network drive

Anonymous
Not applicable

Everyone,

 

I've created a dll file from a VB.NET project and the file loads and runs correctly if I load it from my local machine.  When I load and run from a network drive location I get a message that the "Application attempted to perform an operation not allowed by the security policy..." and I could use Microsoft .NET Framework Configuration tool to grant permission for the application to run.

 

I have no idea where to start using a .NET Framework Configuration tool and was hoping someone could help getting this configured to run correctly.

 

Thanks,

Keith

 

0 Likes
4,124 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

Search this News group, this is a regular question.

 

The problem is that net shared are not considered a "Safe zone" so you have to open your machine up to allow this to run from there, IIRC. In any event, the general consensus to to develop a different deployment strategy.

 

HomeBoy Out

0 Likes
Message 3 of 3

norman.yuan
Mentor
Mentor

The .NET framework configuration tool is called CASPOL.exe. There is used to be a GUI version of it with .NET 1.1. With later version of .NET, it is command line tool only for regular .NET installation.

 

Googling "CASPOL.EXE" will bring you to tons of links on how to use this tool to configure a .NET code group for its access security.

For a quick start, to allow .NET code to be loaded from a folder on the network drive, you simply need to configure a network folder as a code group, and give it certain trust. I'd just give it FullTrust, but the folder is configured in file system this way, so that all users can only read and only dedicated user can read/write (e.g. update the DLLs in that folder). It may be loosening up security too much to give entire network drive FullTrust, unless the network drive is only used for the said .NET code. Anyway, to do this, you run this command:

C:\Windows\Microsoft.net\framework\v2.0.50727\caspol -pp off -machine -addgroup All_Code -url file://server/sharename/foldername/* FullTrust -name My_CAD_Apps -description "AutoCAD Map .NET Applications"

You need to run this on every CAD computer that uses your .NET code in AutoCAD. You also need to have admin right to run it.

Afterward, you can simply drop all your Acad .NET code (or other .NET apps you do not wan to install locally, for that matter) into that network share and load them from there, so when you need to update the code, you only update in one location (well, you may have to force the opened dll file being cloded before you can copy over the update, should someone leave AutoCAD running after work...).

Norman Yuan

Drive CAD With Code

EESignature