Hello,
I get this strange error in my Command Window.
Any ideas what's going on?
My .Net app appears isn't recognizing commands either.
Cannot load assembly. Error details: Autodesk.AutoCAD.Runtime.Exception: eDuplicateKey at Autodesk.AutoCAD.Runtime.Interop.Check(Int32 returnValue) at Autodesk.AutoCAD.Runtime.CommandClass.AddCommand(ICommandLineCallable ca, MethodInfo mi) at Autodesk.AutoCAD.ApplicationServices.AutoCADApplicationHolder.Initialize(Assembly assembly) at Autodesk.AutoCAD.ApplicationServices.ExtensionLoader.ProcessAssembly(Assembly assembly)
Public Sub Initialize() Implements IExtensionApplication.Initialize Try 'add anything that needs to be instantiated on startup 'Step1 'Write Message to Acad Console Window ed.WriteMessage("<<[Initializing - VB.NET:ClassAutocad2011.dll Loaded]>>") ed.WriteMessage(Environment.NewLine) 'Step2 'Check to see if Autocad is Setup Already If Not (modRegistry.IsAcadSetup) Then modAcadSetup.RunSetup_AC2K11() End If 'Step3 -Initalize All Application Events AddAppEvent() 'Step4 -Intialize All Document Events DocEvents.AddDocEvents() 'Step5 -Standard Startup Variables modAcadSetup.TurnFileDialogOn() 'Step6 -Write Text File to M Drive Signaling that Autocad is being used by this User modTextFiles.CreateTextFile_User_OpenedAutocad(Environment.UserName) ed.WriteMessage("<<[Done Initializing Autocad 2011]>>") ed.WriteMessage(Environment.NewLine) Catch ex As System.Exception MsgBox(ex.Message) End Try End Sub Public Sub Terminate() Implements IExtensionApplication.Terminate ' Do plug-in application clean up here 'Autocad .DLL Library is Terminated(Exited) 'handle closing down a link to a database/etc. Console.WriteLine("Cleaning up...") End Sub
Solved! Go to Solution.
Solved by MarkPendergraft. Go to Solution.
I'd start looking here:
http://forums.autodesk.com/t5/NET/2008-NetLoad-Error/td-p/2092595
To quote Tony:
You have multiple CommandMethod attributes, or
LispFunction attributes with the same command
or function name
I think I had 2 functions with the same name, I'd look for that first.
Yep that was it!
Sloppy code... had duplicate Command Methods.
I had two <CommandMethod("listrib")> _ in two different places.
That would make sense why it would hang up autocad and stop recognizing commands as they are global.
Many Thanks for helping me see my blind spot!
I would like to add an additional bit of help in case anyone else needs to know.
You get the same error if you accidentally forget to change the 'Copy Local' property to false when adding a Acad reference to your project ...
Bugged me for a couple of hour because I only had *one* CommandMethod therefore couldn'y understand why the solution was to remove a duplicate!
Hi
i have a little question.
is posible have two CommandMethod in a Class
Saludos
Posting here because $searchEngine brought me here for my error ...
Cannot load assembly. Error details: Autodesk.AutoCAD.Runtime.Exception: eInvalidInput at Autodesk.AutoCAD.Runtime.CommandClass.AddCommand(ICommandLineCallable ca, MethodInfo mi) at Autodesk.AutoCAD.ApplicationServices.AutoCADApplicationHolder.Initialize(Assembly assembly) at Autodesk.AutoCAD.ApplicationServices.ExtensionLoader.ProcessAssembly(Assembly assembly)
Note: eInvalidInput - I hadn't typed anything, the DLL was still loading.
The culprit ... The localized or underscored English command name; must be 64 characters or less in length. Actually, I make it 63 or less, I tested it, 1 character at a time.
Verbosity killed my cat.