Plugin not loading(NETLOAD)

Plugin not loading(NETLOAD)

Anonymous
Not applicable
2,693 Views
4 Replies
Message 1 of 5

Plugin not loading(NETLOAD)

Anonymous
Not applicable

Hello guys,

 

Please help me, I've been creating a plugin(with C#) with MVS 2012, and testing it at CAD 2015, it works fine...but when I sent it by email to a friend( he has CAD 2016), he tried to load my plugin(NETLOAD), it's not working at all, but a few time ago I went to his home with my plugin into a pendrive, it worked easily, what could it be? (since this problem I've been trying to test the same plugin that I send by email, downloading it to my computer again sometimes it works some times CAD returns this message)...I tried load my plugin in two diferent computers...same problem...

  

Cannot load assembly. Error details: System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Péricles Jr\Desktop\latest.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Users\Péricles Jr\Desktop\latest.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.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()

0 Likes
Accepted solutions (1)
2,694 Views
4 Replies
Replies (4)
Message 2 of 5

Jeff_M
Consultant
Consultant
Accepted solution
When you send a DLL via email, or download it from a site, Windows 'Blocks' the file. Find the file in Windows Explorer, right-click, select Properties. On the General tab, towards the bottom, you will likely see a button labeled Unblock...click it.
Jeff_M, also a frequent Swamper
EESignature
Message 3 of 5

Anonymous
Not applicable

Thanks friend, it worked.

 

But now I have another question, how do I configure my code (if it's possible), to make windows stop blocking my plugin?

 

Thanks in advance.

0 Likes
Message 4 of 5

Jeff_M
Consultant
Consultant
If you create an installer for your plugin, then it typically does not get blocked by Windows. I use Inno Setup available for free here: http://www.jrsoftware.org/isinfo.php There are others, I'm sure, but this has worked well for me.
Jeff_M, also a frequent Swamper
EESignature
Message 5 of 5

Anonymous
Not applicable
Thanks friend, you really helped me.
0 Likes