Jump to content

.dll file cant load due to previous .NET


limboz

Recommended Posts

I have a .dll file compiled and written in VB express 2010 back in 2011 by my peer. Fast forward to 2015, Im trying to netload this .dll file with no success. is there anyway to migrate the codes and hopefully a tutorial for it.:D

Cheers

 

This is my error code.

 

Cannot load assembly. Error details: System.IO.FileLoadException: Could not load file or assembly

 

'file:///C:\Users\z3424946\Desktop\BBprop.dll' or one of its dependencies. Operation is not

 

supported. (Exception from HRESULT: 0x80131515)

 

File name: 'file:///C:\Users\z3424946\Desktop\BBprop.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=155569 for more information.

 

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase,

 

Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr

 

pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean

 

suppressSecurityChecks)

 

at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,

 

Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr

 

pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean

 

suppressSecurityChecks)

 

at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,

 

Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, Boolean

 

throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

 

at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence

 

securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean

 

forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)

 

at System.Reflection.Assembly.LoadFrom(String assemblyFile)

 

at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)

 

at loadmgd()

Edited by limboz
Link to comment
Share on other sites

Hi!

 

I just had this error myself and found a solution through Kean Walmsleys post:

 

 

Locate your acad.exe.config file, usually in C:\Program Files\Autodesk\AutoCAD 2015\acad.exe.config.

 

Add:

 

My file looks like this:

 

 

 

 

 

Hope this will help you!

 

/Stephan

Link to comment
Share on other sites

Firstly, and to both of you, welcome to CADTutor.

 

Second, please be mindful to use [code ] Tags. :thumbsup:

 

To the issue, not knowing what is provided in the made-for-2011 assembly you're attempting to load, if enabling LoadFromRemoteSources is unsuccessful, it will likely be due to the fact that the API has been broken since 2011. Put simply, the advent of Core Console (AcCoreMgd.dll) now requires code be recompiled for newer versions, first in 2013, and then again in 2015 following API changes.

 

If the latter is in fact the issue, then you're limited in what steps can be taken, without access to the source-code... Something which we can get into if needed, so long as the original author did not obfuscate the code at compile (unlikely for internal code, YMMV).

 

Cheers

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...