KubaSzostak / Geo7

Geo7 tools for AutoCAD and BricsCAD
MIT License
7 stars 3 forks source link

Could not load file or assembly #1

Open KubaSzostak opened 9 years ago

KubaSzostak commented 9 years ago

There is a problem while loading fresh downloaded Geo7 into BricsCAD:

: NETLOAD

Loading .NET runtime v4.0.30319:

Error Message: Could not load file or assembly 'file:///C:\Program Files\Bricsys\BricsCAD V15 en_US\Support\Geo7\Geo7.BricsCAD.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
; ----- LISP : Call Stack -----
; [0]...BRXLOADMANAGEDDLL <<--
;
; ----- Error around expression -----
(AL_EXECUTEADSDEFUN "BRXLOADMANAGEDDLL" REST)
;
; error : SDS request returned error at function : BRXLOADMANAGEDDLL
failed to load module C:\Program Files\Bricsys\BricsCAD V15 en_US\Support\Geo7\Geo7.BricsCAD.dll

g7-bricscad

bricscad-ver

KubaSzostak commented 9 years ago

The problems is that the .NET Framework CLR v4 security policy model has changed since previous versions and are not sandboxing assemblies as before. This is because the code is extracted from a zip file downloaded from the Internet, so it is treated by Windows as unsafe. The extracted files are also blocked.

Solution 1

Right clicking on all *.DLL files in Geo7 folder, choosing Properties, and then pressing the "unblock" button. The DLL has a stream that is marking it as an external file - and by clicking unblock you remove that designation.

dll-unlock

Solution 2

To fix your issue just find the location of bricscad.exe and create (or edit) a bricscad.exe.config in the same folder with following contents (or add this contents):

<configuration>
  <runtime>
    <loadFromRemoteSources enabled="true" />
  </runtime>
</configuration>

TODO

Fix this problem in future releases. Use stremas.exe from Sysinternals Suite or custom c# code to unblock DLL http://weblogs.asp.net/dixin/understanding-the-internet-file-blocking-and-unblocking