4

I am trying to load my custom .net dll inside accoreconsole.exe (AutoCAD 2016) using netload command but it fails to load the dll.

Below is the output from accoreconsole.exe :

Redirect stdout (file: C:\Users\amitp\AppData\Local\Temp\accc37242).
AutoCAD Core Engine Console - Copyright Autodesk, Inc 2009-2013.

Usage:
AcCoreConsole.exe [/i <input dwg>] /s <script>[/product <product>] [/l <language
>] [/isolate <userid> <userDataFolder>] [/readonly] [/p[rofile] <profile>]

Example:
AcCoreConsole.exe /i 8th_floor.dwg /s test.scr /l en-US
Regenerating model.


**** System Variable Changed ****
1 of the monitored system variables has changed from the preferred value. Use SY
1 of the monitored system variables has changed from the preferred value. Use SY
SVARMONITOR command to view changes.


Command:
Command:

Command:
Command: netload
Command: netload
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoca
dDwgReaderTest\DwgTextExtracter\bin\Debug\DwgTextExtracter.dll"
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoc
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoca
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoca
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoca
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoca
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoca
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoca
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoca
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoca
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoca
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoca
Assembly file name: "C:\Users\amitp\Documents\Visual Studio 2012\Projects\Autoca
dDwgReaderTest\DwgTextExtracter\bin\Debug\DwgTextExtracter.dll"
Unable to load C:\Users\amitp\Documents\Visual Studio 2012\Projects\AutocadDwgRe
Unable to load C:\Users\amitp\Documents\Visual Studio 2012\Projects\AutocadDwgRe
Unable to load C:\Users\amitp\Documents\Visual Studio 2012\Projects\AutocadDwgRe
Unable to load C:\Users\amitp\Documents\Visual Studio 2012\Projects\AutocadDwgRe
Unable to load C:\Users\amitp\Documents\Visual Studio 2012\Projects\AutocadDwgRe
aderTest\DwgTextExtracter\bin\Debug\DwgTextExtracter.dll assembly.
Command:

Is there anything else I need to do before loading the dll ?

NOTE: This dll is not signed.

Thnaks

amit
  • 363
  • 2
  • 10
  • 24

2 Answers2

5

Check 2 things:

  1. make sure you use only AcCoreMgd.dll and AcDbMgd.dll references
  2. place the DLL at a trusted location, such as AutoCAD (acad.exe) folder or under Program Files folder.
Augusto Goncalves
  • 8,493
  • 2
  • 17
  • 44
  • 2
    for future readers, my understanding is that: acmgd.dll should not be called, neither can u make use of GUI functionalities, use only the main references like Augusto says. – BenKoshy Dec 10 '15 at 00:15
  • that's correct @BKSpurgeon, AcMgd.dll CANNOT be used on plugins for AcCoreConsole. – Augusto Goncalves Dec 10 '15 at 00:23
  • Where you add those references set `Copy Local` to `False`, it uses the local DLLs at runtime – CAD bloke Dec 22 '21 at 01:33
2

This doesn't answer the non-loading (Augusto answered that)... The weird output you are seeing is due to a bug introduced in v2015 with the Core Console. The reasons and workarounds were discussed at http://forums.autodesk.com/t5/net/accoreconsole-exe-in-2015-doesn-t-do-system-console-writeline/m-p/5539352#M43603

I found an easier workaround, in the console window that opens, click the top-left icon of the window => "Defaults"=> , Layout tab, set the screen buffer size width and windows size widths to something silly like 150, it still does the telex-machine thing but at least it doesn't repeat itself.

Note - Autodesk are very fond of breaking links to their things so post a comment here i they broke it and I'll fix that.

CAD bloke
  • 8,578
  • 7
  • 65
  • 114