.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AppAutoload in 2013 LoadOnCommandInvocation seems broken

22 REPLIES 22
SOLVED
Reply
Message 1 of 23
tyronebk
1874 Views, 22 Replies

AppAutoload in 2013 LoadOnCommandInvocation seems broken

I have searched but have been unable to find anything related to this. This is not strictly a .net issue.

Is LoadOnCommandInvocation="True" broken in 2013? It used to work fine in 2012 but in 2013 all .DLL and lisp files are simply being loaded at launch?

Even the simple DOTNETTEST2 bundle (made available by the APN Dev guys last year) show the same behaviour.

Is there something I'm missing?

Here's the PackageContents.xml from the DOTNETTEST2:

Spoiler

<?xml version="1.0" encoding="utf-8" ?>

<ApplicationPackage SchemaVersion="1.0" >

<Components>

<ComponentEntry AppName="DOTNETTEST2" ModuleName="./Contents/2013/AutoloaderDotNetSample2.dll" LoadOnCommandInvocation="True" >

<Commands GroupName="DevDays2010">

<Command Global="DOTNETTEST2" Local="DOTNETTEST2" />

</Commands>

</ComponentEntry>

</Components>

</ApplicationPackage>

I searched through the now redacted SP 1 release notes and saw no mention of this problem.

22 REPLIES 22
Message 2 of 23
fenton.webb
in reply to: tyronebk

Can you send your test bundle please?

 

Also, a .NET DLL that ran in 2012 won't run in 2013... The DLL needs to be built against the 2013 ObjectARX SDK because 2013 is a binary break release. You can include both 2012 and 2013 DLL's in the same bundle, but you have to separate the Components by using the RuntimeRequirements tag... e.g.

 

<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage SchemaVersion="1.0" Name="DOTNETTEST2" Description="DOTNETTEST2" AutodeskProduct="AutoCAD" AppVersion="1.0.0" ProductType="Application" >

     <!-- This is an overview of the entire package, it can also contain Revit, Alias, Vault, Inventor plugins too -->
    <RuntimeRequirements OS="Win32|Win64" Platform="AutoCAD|AutoCAD*" SeriesMin="R18.2|R19.0" SeriesMax="R18.2|R19.0" />
  <Components>

    <!-- Here is the 2012 version of your AutoCAD App -->
    <RuntimeRequirements OS="Win32|Win64" Platform="AutoCAD|AutoCAD*" SeriesMin="R18.2" SeriesMax="R18.2" />
    <ComponentEntry AppName="DOTNETTEST2" ModuleName="./Contents/2012/AutoloaderDotNetSample2.dll" LoadOnCommandInvocation="True">
      <Commands GroupName="DevDays2010">
        <Command Local="DOTNETTEST2" Global="DOTNETTEST2" Description="A test command" />
      </Commands>
    </ComponentEntry>
  </Components>
  <Components>
    <!-- Here is the 2013 version of your AutoCAD App -->

    <RuntimeRequirements OS="Win32|Win64" Platform="AutoCAD|AutoCAD*" SeriesMin="R19.0" SeriesMax="R19.0" />
    <ComponentEntry AppName="DOTNETTEST2" ModuleName="./Contents/2013/AutoloaderDotNetSample2.dll" LoadOnCommandInvocation="True">
      <Commands GroupName="DevDays2010">
        <Command Local="DOTNETTEST2" Global="DOTNETTEST2" Description="A test command" />
      </Commands>
    </ComponentEntry>
  </Components>




Fenton Webb
AutoCAD Engineering
Autodesk

Message 3 of 23
tyronebk
in reply to: fenton.webb

Hi Fenton -- thanks for your reply.

 

I am aware of all the versioning attributes and that coding/recompiling is necessary for 2013. I excluded all of that for brevity and simplicity. I also thought that maybe the version attributes were causing the issue so I went with the simplest plug-ins I could find, the DotNetTest bundles.

 

I've attached the recompiled 2013 versions of the DotNetTest bundles. These bundles both are being loaded at launch. The 2012 versions (not included) launch when expected.

 

I also included a sample "universal" bundle (DotNetTestsAllInOne.bundle) that supports both 2012 and 2013. Regardless, the result is the same: 2012 loads AutoloaderDotNetSample1.dll at launch and AutoloaderDotNetSample2.dll on command invocation, 2013 loads both at launch.

 

I reset all of my settings but that has made no difference. I have vanilla AutoCAD and Civil 3D installed and both show the same behaviour.

 

The bundles are being recognized properly as the Applications registry entries show (in both 2012 and 2013):

  • DOTNETTEST1: LOADCTRLS = 2
  • DOTNETTEST2: LOADCTRLS = 4

All custom plug-ins and plug-ins acquired from the Exchange store show the same behaviour. As I mentioned initially, this is not specific to DLLs as LSP/VLX/FAS files are also being loaded at launch.

 

Thanks for your time and any insights.

 

Edit: I've just installed and tested SP1.1 but the result is the same.

Message 4 of 23
fenton.webb
in reply to: tyronebk

I'm just looking into it for you...




Fenton Webb
AutoCAD Engineering
Autodesk

Message 5 of 23
fenton.webb
in reply to: fenton.webb

Just to let you know that I have reproduced the same issue on my machine and I've reported it to engineering. I'll push to get this fixed for you.




Fenton Webb
AutoCAD Engineering
Autodesk

Message 6 of 23
tyronebk
in reply to: fenton.webb

Thanks for confirming it Fenton.
Message 7 of 23

Has there been any solution to this?

It appears to be broken in AutoCAD 2014

I can only get my apps to load with LoadOnAutoCADStartup="True"

Funny it works with AutoCAD 2013 now. Maybe SP 1.1 fixed it there?

 

I'm trying to get an app ready for posting to the exchange store and it would be nice to be able to follow the recommended "LoadonCommandInvocation" method.

 

-steve

 

Message 8 of 23

You might expect it to be fixed in a service pack, but these days, waiting for service packs is considered a thing of the past, and no longer acceptable, not to mention a bit of an oxymoron in the case of a vendor that seems to be into cloud-washing to the extent these folk are.

 

The thing that puzzles me, is how these types of glaringly-obvious bugs find their way into shipping products, and worse, survive to the next release.  

Message 9 of 23

Sorry for the trouble... Just be sure to setup the OnCommandInvocation settings for when the issue is fixed.




Fenton Webb
AutoCAD Engineering
Autodesk

Message 10 of 23

So, knowing that it is an issue, do you have any expectations for when a fix will be released?

I'd rather not release my app while it throws an "Unknown Command" error.

 

 

Message 11 of 23

I'm wondering if there is any progress in this. Fenton wrote a white paper early this year (01/02/2013) in Autocad DevBlog, but didn't mention there was any issues. Is this fixed in 2014?

 

 

Message 12 of 23
Balaji_Ram
in reply to: vincent.gu

Hi Vincent,

 

Yes, the "LoadOnCommandInvocation" should work ok in AutoCAD 2014.

 

Regards,



Balaji
Developer Technical Services
Autodesk Developer Network

Message 13 of 23
osvaldast
in reply to: vincent.gu

AutoCAD 2014 SP1 LoadOnCommandInvocation does not work, AutoCAD 2015 beta2 (build 497) LoadOnCommandInvocation does not work.

Message 14 of 23
dgorsman
in reply to: osvaldast

It is INAPPROPRIATE to post comments on BETA-releases in this forum.  You agreed to a non-disclosure agreement (NDA) in order to participate, and it should not be taken lightly.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 15 of 23
osvaldast
in reply to: osvaldast

Apologies, I only intended to report an issue with AutoCAD 2014 SP1, please disregard my comment regarding the beta.

Message 16 of 23
StephenPreston
in reply to: osvaldast

Hi osvaldest,

 

I have AutoCAD 2014 sp1, and LoadOnCommandInvocation seems to work fine for me. Could you attach a (simple) sample PackageContents.xml that doesn't work for you, so I can take a look. One common problem with LoadOnCommandInvocation is not specifying a group name in your CommandMethod attribute and/or not using exactly the same string in the Group parameter of the <Commands/> element.

Cheers,

Stephen Preston
Autodesk Developer Network
Message 17 of 23
osvaldast
in reply to: StephenPreston

Hi Stephen,

 

Please find Hello world bundle attached, with two writeline messages of Hello World on initialise and on HW_HelloWorld command execution (source code included in contents folder). The attachment uses simple PackageContents.xml which works great on AutoCAD 2013 SP2. AutoCAD 2014 SP1's intellisense lists command, but fails to execute it (Unknown command). If I change LoadOnCommandInvocation="True" attribute with LoadOnAutoCADStartup="True", it works great.

 

Thank you very for looking at this issue.

 

PackageContents.xml content:

 

<?xml version="1.0" encoding="utf-8" ?>
<ApplicationPackage SchemaVersion="1.0" AppVersion="1.2.3.4"
Name="Hello World">
<CompanyDetails
Name="Hello World Engineering"
Email="support@hello.world"
/>
<Components>
<RuntimeRequirements
SupportPath="./Contents"
Platform="Civil3D"
OS="Win64"
SeriesMin="R19.0"
SeriesMax="R19.2" />

<ComponentEntry AppName="Hello_World"
ModuleName="./Contents/HelloWorldAutoLoader.dll"
LoadOnCommandInvocation="True">
<Commands GroupName="HW_Group">
<Command Local="HW_HelloWorld" Global="HW_HelloWorld" />
</Commands>
</ComponentEntry>

</Components>
</ApplicationPackage>

 

Message 18 of 23
StephenPreston
in reply to: osvaldast

Hmm. That looks ok. Could you also paste the CommandMethod attribute for the HW_HelloWorld command, and tell me the value of your APPAUTOLOAD sysvar?

 

 

Cheers,

Stephen Preston
Autodesk Developer Network
Message 19 of 23
osvaldast
in reply to: StephenPreston

Hi Stephen,

 

APPAUTOLOAD sysvar value is set to 14.

My command method attribute looks like this: [CommandMethod("HW_HelloWorld")]. Please find the testing calss bellow:

 

public class Class1 : IExtensionApplication
{
[CommandMethod("HW_HelloWorld")]
public void HelloWorld()
{
Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\nHello World");
}

public void Initialize()
{
Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\nInitialising Hello World Application");
}

public void Terminate()
{
}
}

 

Thanks

Message 20 of 23
StephenPreston
in reply to: osvaldast

You haven't specified a Groupname in your CommandMethod attribute. This is the potential problem I mentioned in an earlier reply.

 

In your code, try replacing

 

[CommandMethod("HW_HelloWorld")]

 

with

 

[CommandMethod("HW_Group", "HW_HelloWorld", CommandFlags.Modal)]

Cheers,

Stephen Preston
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost