In the acad.exe.config file, I had to add the line in the runtime section:
<loadFromRemoteSources enabled="true"/>
Is there a way to avoid this? It loads fine without the addition on my laptop that I developed the DLL, but on our training PCs it will not load without the added line.
Solved! Go to Solution.
Solved by augusto.goncalves. Go to Solution.
@DENNIS wrote:In the acad.exe.config file, I had to add the line in the runtime section:
<loadFromRemoteSources enabled="true"/>
Is there a way to avoid this? It loads fine without the addition on my laptop that I developed the DLL, but on our training PCs it will not load without the added line.
More information is needed.
On your training PC, where is the assembly being loaded from (i.e., local disk, or network)?
Are you using Autoloader, your own registry loader, or manual/LISP call to NETLOAD Command?
"How we think determines what we do, and what we do determines what we get."
Right at this time, I am trying to load the DLL manually via the NETLOAD command. I have placed the DLL first in the folder "C:\Program FIles\Autodesk\AutoCAD 2015\PLNT". Then tried a network drive and made the folder there Trusted. Then I tried the local C:drive. Each time I got the same message that it could not be loaded, and the message then refered me to the Microsoft help to add the <loadFromRemoteSources enabled= to be added in the runtime section of the acad.exe.config.
Eventually I would like to Autoloader it, but I need to resolve this first.
Hi,
The MS documentation says that "In Framework 4.5 assemblies on local network shares are run as full trust by default; you do not have to enable the <loadFromRemoteSources> element". So it's not a normal behavior, did you target Framework 4.5 in your project setup?
Gaston Nunez
Yes. Right-click the project name, pick Properties. It shows Target Framework = .NET Framework 4.5. Application type = WPF Class Library. Could the Application Type be wrong?
An update too: when I move the DLL out of the x64/debug folder, it would not load on my laptop used for development either without the <loadFromRemoteSources enabled=
If you have a .NET DLL on a remote location, for instance, a network path, then you need to add this loadFromRemoteSources attribute.
If is local, then no need.
As you plan to actually deploy on the machine, just use the Apploader mechanism, much better. You might need a second DLL that will check the server for a newer version, but that will need custom implementation.
@augusto.goncalves wrote:If you have a .NET DLL on a remote location, for instance, a network path, then you need to add this loadFromRemoteSources attribute.
If is local, then no need.
As you plan to actually deploy on the machine, just use the Apploader mechanism, much better. You might need a second DLL that will check the server for a newer version, but that will need custom implementation.
Augusto,
The OP is using AutoCAD 2015 (.NET Framework 4.5), thus LoadFromRemoteSources XmlAttribute *should not* be needed as Gasty points out above... If the OP's assembly is not being NETLOADed properly from network location, there's another issue at play.
Also, unless I've missed an ADN email, I believe you meant "Autoloader Mechanism" and not "Apploader Mechanism."
Cheers
"How we think determines what we do, and what we do determines what we get."
Thanks for the additional comments...
Yes, Autoloader mechanism (using .bundle folder and PackageContents.xml)