.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to load dll via netload

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
3172 Views, 4 Replies

Unable to load dll via netload

Hi, I'm new to Autocad C# API. 

 

From the beginner's video tutorial, I tried the code to load my dll into AutoCAD, through NETLOAD. But it isnt loading... The error is "Unable to load <dll path.dll> assmebly" what should I do in this case? please help me...

 

Project type:

Class Library (c#|Windows)

 

Code:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;

namespace ClassLibrary1_Test3
{
public class Class1
{

[CommandMethod("mycommandinputtest")]
public void MyTestCommandCodeMethod()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;

ed.WriteMessage("\nThis is a test message that myTestCommand is working!!!");


}

}
}

 

 

 

Softwares:

Autocad 2020

Visual Studio Community 2019

 

Steps Followed:

1. Installed ObjectARX files, referenced them, set copy local to "FALSE"

2. Tried running them both as Administrators.

3. Set target .Net Framework to version 4.7 (as given in release notes of AutoCAD 2020)

 

I really dont know what am I doing wrong here... 

 

Really need your help..thanks. 

Sibe R. 

Tags (3)
Labels (4)
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

maybe shooting in the dark, but can you right click on DLL and see if there is an option to "unblock" it?

https://www.limilabs.com/blog/unblock-dll-file

Message 3 of 5
Anonymous
in reply to: Anonymous

Hi, thanks for the reply. I've found solution to this problem couple of days back. Forgot to update here. 

 

The thing is, I had to make the solution - bin - debug folder as trusted folder in autocad settings. Dont know why it asks like this, never encountered such problem before. but once I added that repos/solution/bin/debug folder to trusted folder list, I was able to add this dll into my Autocad Application.  - Screenshot attached..

 

Upon research, I found out that the solution you have provided is also valid... but specifically when the dll being created from another source, transferred to some other machine, windows will ask for that block/unblock procedure in properties. 

Message 4 of 5
_gile
in reply to: Anonymous

Hi,

I'm glad to know you find the solution by yourself.

FYI, you can set repos/... as trusted folder so that any DLL in this folder and its sub directorues will be trusted.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 5 of 5
Anonymous
in reply to: _gile

Oh Great! Thanks for the tip. Now I dont have to do it every time I create a project...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report