Ensuring your AutoCAD .net DLL runs on another computer - How to set it all up? (AutoCAD .net API)

Please follow the follow steps to ensure that your .net dll works:

Notes for the plugin user:

The first and most important thing:

  1. Make sure you have the dll and additional dependencies required.

  2. Put the dll in a “trusted” location. Please refer to: #1: http://www.ccadinc.com/autocad-tutorials-trusted-locations.html .

  3. Make sure that you have downloaded and installed .Net. Get the latest version: https://www.microsoft.com/net/download/framework

  4. You need to find your AutoCAD folder. It is somewhere in the vicinity of: C:\Program Files\Autodesk\Your Version but that may vary depending on the version of Windows you are using and where AutoCAD is installed. Important: (a) Make sure you have admin privileges to edit the config file and (b) please make sure that AutoCAD is not running. Anyways go to your installation folder. Now look for your acad.exe.config file. Here’s mine:

_config.yml

Open that file in some sort of word processor. And you need to edit that file. You need to add the following lines to it:

  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>

So then your acad.exe.config file should look something like this:

_config.yml

Don’t forget to ensure that you can load from remote sources too!

_config.yml

And your .net dll should be able to work!

Help! Exception in acmgd.dll ARX Command - Unhandled Exception E0434F4D

_config.yml

ok in order to solve this, you need to navigate to the following folder:

C:\Windows\Microsoft.NET\Framework\

Now click select the latest version of .Net you have. For me it was v4.0……..etc but you’ll have to click on which ever is your latest version. Then navigate to the Config folder.

C:\Windows\Microsoft.NET\Framework\v4.0.yoursMayBeDifferent\Config

And then you need to find the machine.config file. See picture below. You need to ensure that the machine.config file has read & execute as well as read permissions, for the users group.

  1. Right click on the machine.config file with your mouse.

  2. Click on the Security tab.

  3. Go to users.

  4. Check whether the correct permissions are allowed. The “Users” group needs: (i) Read & Execute as well as (ii) Read permissions.

  5. If that group doesn’t have those permissions you need to change them. You might require admin access.

  6. Press Ok etc.

_config.yml

Here is a gif showing you how to get all of that done.

_config.yml

Notes for the plug-in developer:

  1. Users may face memory problems etc. Please confirm that these sorts of issues are not causing the problem.

  2. Make sure – if you’re using an installer - that it is correctly set up. Check out this StackOverflow answer: http://stackoverflow.com/a/33381308/4880924

Hope this helps.

Ben

Written on March 16, 2017