Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands are dropped when CommandItemInfo is applied. #104

Open
geoffgscott opened this issue Jul 7, 2023 · 3 comments
Open

Commands are dropped when CommandItemInfo is applied. #104

geoffgscott opened this issue Jul 7, 2023 · 3 comments
Assignees

Comments

@geoffgscott
Copy link

If CommandItemInfo is applied the commands disappear from the command tab (for all document types). Tested on both SW2021 and SW2022.

[Title("Power Tools")]
public enum Commands_e
{
    // below line causes command to disappear
    [CommandItemInfo(WorkspaceTypes_e.AllDocuments)]
    [Icon(typeof(Resources), nameof(Resources.electric_drill))]
    Drill,
    [Icon(typeof(Resources), nameof(Resources.electric_screwdriver))]
    Screwdriver,
    [Icon(typeof(Resources), nameof(Resources.power_saw))]
    Saw
}

Minimal reproduction here:
https://github.com/geoffgscott/CommandPanelTest

@artem1t artem1t self-assigned this Jul 10, 2023
@artem1t
Copy link
Contributor

artem1t commented Jul 10, 2023

Did you run the installer on the dev machine (e.g. where it was compiled)? If so, please make sure that the dev version is not registered:

• Clear the solution
• Start SOLIDWORKS to see if there is no add-in
• Install from the installer
• Validated that files in the installation folder match the build (e.g. there are no missing files)

Users reported issues with the VSI installer (COM objects were not registered). I am using WiX

Try to add Try-catch block within your OnConnect to see if there is an exception (it can be an exception if you have previous dev version of the add-in registered due to the conflict of the ids)

If the above does not work, please try to register manually with regasm /codebase.

If none of the above works, we can schedule an online meeting to troubleshoot.

@geoffgscott
Copy link
Author

To clarify this appears to be unrelated to the installer at all. Issue is noticed both in local development (even after running a project clean) as well as in a bundled install (installed to a separate clean machine instance).

Looks to be specifically related to this line [CommandItemInfo(WorkspaceTypes_e.AllDocuments)]

@artem1t
Copy link
Contributor

artem1t commented Jul 12, 2023

@geoffgscott we can organize an online meeting to resolve this. I have sent you an e-mail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants