Results 1 to 4 of 4

Thread: My First Plugin - Failure

  1. #1
    I could stop if I wanted to
    Join Date
    2015-10
    Posts
    215
    Login to Give a bone
    0

    Default Solved - My First Plugin - Failure

    So I started Autodesk tutorial "My First Plugin" - http://usa.autodesk.com/adsk/servlet...12&id=18162797

    I entered and compiled the code as directed. Upon loading it in AutoCAD I get the following error:

    "Cannot load assembly. Error details: System.IO.FileLoadException: Could not load file or assembly 'file:///P:\Projects\KeepAttributesHorizontal\KeepAttributesHorizontal\bin\Release\KeepAttributesHorizontal.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
    File name: 'file:///P:\Projects\KeepAttributesHorizontal\KeepAttributesHorizontal\bin\Release\KeepAttributesHorizontal.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, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, 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()


    So, in case I just typed something wrong, I copied and pasted the code from the tutorial and recompiled it. Same error.
    My system specs are as follows:

    MS Windows 7 64-bit SP1
    AutoCAD 2013 64-bit


    Any suggestions?
    Last edited by mikehaff; 2012-08-10 at 07:02 PM. Reason: Solved

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: My First Plugin - Failure

    Quote Originally Posted by mikehaff View Post

    "Cannot load assembly. Error details: System.IO.FileLoadException: Could not load file or assembly 'file:///P:\Projects\KeepAttributesHorizontal\KeepAttributesHorizontal\bin\Release\KeepAttributesHorizontal.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
    File name: 'file:///P:\Projects\KeepAttributesHorizontal\KeepAttributesHorizontal\bin\Release\KeepAttributesHorizontal.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, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, 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()
    Consider loading the assembly from a local directory instead of a network location.

    If you must load the assembly from a network location, then consider this thread when modifying acad.exe.Config (after you make a backup copy):

    Loading blocked and network-hosted assemblies with .NET 4

    HTH
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    I could stop if I wanted to
    Join Date
    2015-10
    Posts
    215
    Login to Give a bone
    0

    Default Re: My First Plugin - Failure

    Thank you Renderman. That did it. I decided to just move it to my local drive for now. I will keep training and experimental work local for now. I also appreciate the link to the explanation as to why this was happening.

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: My First Plugin - Failure

    Quote Originally Posted by mikehaff View Post
    Thank you Renderman
    No worries; I'm happy to help.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. 2011: 3D sketch failure - how to figure out where the failure is??
    By dcook87725927 in forum Inventor - General
    Replies: 1
    Last Post: 2011-05-05, 02:34 PM
  2. 3D DWF failure from Civil 3D
    By mpeterson79 in forum Design Review - General
    Replies: 0
    Last Post: 2007-10-02, 09:14 PM
  3. Failure to Upgrade to 9.1
    By efeiss in forum Revit Architecture - General
    Replies: 0
    Last Post: 2006-11-07, 02:51 PM
  4. dimensioning failure
    By alli_lung in forum ACA General
    Replies: 6
    Last Post: 2005-06-07, 03:48 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •