.NET

Reply
Valued Contributor
mario.rosenbohm
Posts: 56
Registered: ‎12-06-2006
Message 1 of 3 (180 Views)

Problem with "Extension of an plugin"

180 Views, 2 Replies
05-05-2013 05:36 PM

Hallo,

I have a finished plugin (dll-A), which works well.
Now I want to write an extension for it (dll B).
The function in the expansion are so special that I do not in
want to integrate the finished plugin (dll A).
I bind the dll to the plugin (dll-A) into the new dll of the plugin (dll B) and inherit the plugin class (class A) in the plugin class (class B).
Is loaded by the netload (dll B).
He throws the following error:

 

   Autodesk.AutoCAD.Runtime.Exception: eDuplicateKey
   bei Autodesk.AutoCAD.Runtime.Interop.Check(Int32 returnValue)
   bei Autodesk.AutoCAD.Runtime.CommandClass.AddCommand(ICommandLineCallable ca, MethodInfo mi)
   bei Autodesk.AutoCAD.ApplicationServices.AutoCADApplicationHolder.Initialize(Assembly assembly)
   bei Autodesk.AutoCAD.ApplicationServices.ExtensionLoader.ProcessAssembly(Assembly assembly)

Exist in both dll's no duplicate commands!
On debugging looks as if autocad load first dll-A and than load dll-B.

Can it be that the (dll-A) is loaded twice?
If so how can I overcome this?

regards Mario

ADN Support Specialist
fenton.webb
Posts: 352
Registered: ‎07-24-2007
Message 2 of 3 (136 Views)

Re: Problem with "Extension of an plugin"

05-09-2013 09:14 AM in reply to: mario.rosenbohm

We need a build able sample to look at really. Do youuse the CommandClass attribute in both?





Fenton Webb

Developer Technical Services

Autodesk Developer Network


Valued Contributor
mario.rosenbohm
Posts: 56
Registered: ‎12-06-2006
Message 3 of 3 (110 Views)

Re: Problem with "Extension of an plugin"

05-15-2013 10:19 AM in reply to: fenton.webb

Hello,

 

excuse me, we spend a few days on holiday.

 

... yes both dll's (A, B) use the CommandClass attribute.

 

I have found an Solution for me (parallel post on "TheSwamp")


... AutoCAD loaded all linked Dll's from the dll-B on netload-command.
But the dll-A is also a plugin-dll (has the pluginclass-A), hence loaded autocad the implement commands
from pluginclass-A.
All command of the pluginclass-A from dll-a is inherit in pluginclass-B in dll-B.
Therefor crasht the Commandloader on load plginclass-B.

I have solved the problem by extract all functionality that use the pluginclass-B from pluginclass-A into
new class without Commands. That works fine.


Have your another solution? It's interest me for future projects.

 

regards Mario

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community