-
Notifications
You must be signed in to change notification settings - Fork 123
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
Running multiple add-ins at the same time #86
Comments
I'm making some good progress. Status can be seen here. |
I fixed unloading the task pane by adding the AddInTitle property to the task pane, then getting the parent addin by this title. If a user forgets to set this property, the first add-in is used. I don't like to get objects by their names. SolidWorks does that way too often, sometimes with terrible results. I just couldn't think of another way to get the parent add-in yet. |
I have removed the SolidAddIn singleton from IoC because we can have multiple add-ins now. I added getting the parent add-in by name, using the new AddInTitle property in TaskPaneIntegration. Not ideal but it works. I moved getting the reference assemblies to the SolidAddIn ctor. I'm not really happy with the whole situation of how names are set, and the hopping between creating an add-in and plugins. There are basically two situations: 1: Registering in COM 2: Running the add-in |
Replaced AddInTitle from the previous comment by passing along the add-in type when creating a task pane in the same way the Host is passed. |
I noticed that the IoC setup ran for every add-in, so I moved it from the SolidAddIn instance to the static AddInIntegration and skip the setup for non-first add-ins. That means ConfigureServices isn't called on the non-first add-ins, but I don't know how to update the existing setup 😞 |
Hey will take a look from my end cause it's awesome idea and i'm going to use it in upcoming project. |
If we can't update the existing IoC setup, we could initialize it again when the second add-in loads. That's what it does now by accident. We can call ConfigureServices for each add-in when the second add-in loads. I don't know if it's a good idea though. If both add-ins would add logging, I think the logging for both add-ins will be written to both outputs. Not a terrible problem, it could just be unexpected and confusing for developers to see logging from another product show up in your logs. Luke, have you recently had contact with SolidWorks about why two DLLs with the same file name are not loaded properly? I'm emailing with Mick Kozikowski, but I'm having trouble conveying the problem and the severity. |
I just tried to copy the entire SolidDna project to my second add-in, then renamed the project and renamed the namespace. I would think that everything is now unique, so SolidWorks would be able to use both instances. But no, they still interfere with each other. Very strange. I will ask for some help this week, I still have no idea how to fix this. |
I spoke to Artem Taturevych about this issue today, he kindly offered to help out a bit. A few of my notes from that meeting:
His advice:
Removing static classes is basically what I tried last December when I opened this issue. I removed the static AddinIntegration but left the static IoC, which then became the problem. Edit: I didn't make it stateless though. I also experimented a bit today:
This allowed me to start up two add-ins with one plugin each from different solutions. Shutting down nicely doesn't work yet, but that's doable. I got that to work last year. |
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:
Shutting down one add-in does not go well:
My suggestions are:
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 :)
The text was updated successfully, but these errors were encountered: