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.
Solved! Go to Solution.
maybe shooting in the dark, but can you right click on DLL and see if there is an option to "unblock" it?
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.
Can't find what you're looking for? Ask the community or share your knowledge.