-
Notifications
You must be signed in to change notification settings - Fork 128
Open
Description
I'm running into the fact that SolidDna can't really run two add-ins at the same time. Since SolidWorks can't differentiate two dll's with the same name, only one instance of SolidDna runs. If both add-ins use the same version for all libraries, they might start.
I've done some debugging today and this is what I'm seeing. What happens when you start the second add-in is:
- AddInIntegration's static properties SolidWorksAddInTitle, SolidWorksAddInDescription and SolidWorks are overwritten.
- PlugInIntegration.Plugins is overwritten with the plugins from the second add-in.
- Both add-ins actually may start properly
Shutting down one add-in does not go well:
- When you unload one of the add-ins using the Add-ins window in SolidWorks, PlugInIntegration.DisconnectedFromSolidWorks is called
- DisconnectedFromSolidWorks is called on each plugin in Plugins. Plugins contains only the plugins for the add-in that was loaded last. So the wrong items may be unloaded.
- AddInIntegration.SolidWorks is set to null
- When the second add-in is unloaded, the Disconnect event gets fired, but the wrong add-in might be informed and the SolidWorks property is already null. So sometimes the second add-in doesn't unload and then a SolidWorks process keeps running.
My suggestions are:
- To make AddInIntegration's static properties SolidWorksAddInTitle, SolidWorksAddInDescription (and SolidWorks?) instance properties
- Store a list of plugins in the add-in instance, remove the static list of plugins. Move PluginDetails as well?
- Create a static list of add-ins. Add the add-in in its ctor, remove it from the list in AddInIntegration.DisconnectFromSW.
I'm already making these changes, but I'm having trouble overseeing the implications. So if anyone would like to help that would be great :)
Metadata
Metadata
Assignees
Labels
No labels