.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Loading a Framework 4.0 DLL from a network drive

5 REPLIES 5
Reply
Message 1 of 6
jerry.bryant
1115 Views, 5 Replies

Loading a Framework 4.0 DLL from a network drive

OK...please don't refer me to a previous post about this...I just looked at those previous posts...and none anwer my question.

 

Can you run a 4.0 DLL from a network location?

 

I can run it on my machine.....

 

(And yes, I hvae posted similar questions recently...)

 

I had a user install AutoCAD 2011

I had that user Download .NET Framework 4.0

I had user update his acad.exe.config file accordingly (To allow 4.0)

When he tried to load the DLL from a network location...he got:

 

Cannot load assembly. Error details: System.IO.FileLoadException: Could not load file or assembly 'file://\\hoppfil014\ho_255\fd-ac2011\AutoVSL.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)File name: 'file://\\hoppfil014\ho_255\fd-ac2011\AutoVSL.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569for more information. Not sure why I CAN load the same DLL from the network...but he can't...anyway Went to the link listed above....for info..and it talks about: <loadFromRemoteSources>...enabling this So....how is one supposed to do this?...Where is this setting? Surely the answer is NOT............."You can't run DLL's from netwotrk locations.." Please don't tell me this 
Jerry Bryant
"Swing hard and hope you hit it!"
5 REPLIES 5
Message 2 of 6
norman.yuan
in reply to: jerry.bryant

This topic has been discussed here many times.

 

You need to configure the computer for the .NET security if the .NET code is loaded from outside the local computer (from LAN/iThe Internet...) with tool CASPOL.exe.

 

Google "CASPOL.exe" for learn more on this topic.

 

At this moment, you first want to verify if your .NET4 DLL works with a user's Acad2011 with .NET 4 installed. So, copy the DLL to local (or even just use a mamory stick) and do your test. You'd worry about loading DLL from network drive later.

 

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 6
jerry.bryant
in reply to: norman.yuan

OK.....got it....thx

 

I thought one of the "advantages" of the .NET programming environment....Was the ability to run an app from a centralized location.....not haveing to Copy and Register DLL's locally as you had to do with VB 6.0 etc.......Is this crap any different?

 

Frustrating....

Jerry Bryant
"Swing hard and hope you hit it!"
Message 4 of 6
norman.yuan
in reply to: jerry.bryant

There is no comparable counterpart to .NET's code security configuration in COM DLL (VB6 dll). By the way, you can place a VB6 DLL (COM DLL) in a network folder (central location) and do regsvr32 it from there.

Norman Yuan

Drive CAD With Code

EESignature

Message 5 of 6
jerry.bryant
in reply to: norman.yuan

"....VB6 DLL (COM DLL) in a network folder (central location) and do regsvr32 it from there......"

 

But each user (client machine) must regsvr32 it right?

 

I thought .NET was supposed to do away with that?

Jerry Bryant
"Swing hard and hope you hit it!"
Message 6 of 6
dgorsman
in reply to: jerry.bryant

Sort of, but not really.  The Frameworks collect all those little methods, properties, objects, and other goodies so you don't have to do them all yourself, enabling you to do more in less time.  If you need something uber-optimized you can still write your own to replace them.  With all that power comes the possibility of it being used to do nasty things, so the default security settings are quite tight.  Its generally easier to duplicate what other software is doing, which is locating its operation DLLs on the users computer while providing the option of reading data-only files from a network.

 

It requires a little extra planning up front (where to locate, use scripting or bootstrap DLL to copy-local, version control, roll-backs, timing, etc.) but there are some benefits.  You don't need to diddle with security settings on everybody's computer that may or may not be locked down.  DLLs can't be overwritten while they are loaded, which can be a pain if they are being loaded from the same network location (middle of the night, you say?  There's always a few users who never log off or even close the program overnight).

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost