{"action":"created","issue":{"url":"https://api.github.com/repos/angelsix/solidworks-api/issues/25","repository_url":"https://api.github.com/repos/angelsix/solidworks-api","labels_url":"https://api.github.com/repos/angelsix/solidworks-api/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/angelsix/solidworks-api/issues/25/comments","events_url":"https://api.github.com/repos/angelsix/solidworks-api/issues/25/events","html_url":"https://github.com/angelsix/solidworks-api/issues/25","id":305192030,"number":25,"title":"Plugin loads twice when two addins use SolidDna","user":{"login":"brinkdinges","id":15387410,"avatar_url":"https://avatars1.githubusercontent.com/u/15387410?v=4","gravatar_id":"","url":"https://api.github.com/users/brinkdinges","html_url":"https://github.com/brinkdinges","followers_url":"https://api.github.com/users/brinkdinges/followers","following_url":"https://api.github.com/users/brinkdinges/following{/other_user}","gists_url":"https://api.github.com/users/brinkdinges/gists{/gist_id}","starred_url":"https://api.github.com/users/brinkdinges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brinkdinges/subscriptions","organizations_url":"https://api.github.com/users/brinkdinges/orgs","repos_url":"https://api.github.com/users/brinkdinges/repos","events_url":"https://api.github.com/users/brinkdinges/events{/privacy}","received_events_url":"https://api.github.com/users/brinkdinges/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-03-14T14:51:05Z","updated_at":"2018-05-02T09:47:32Z","closed_at":"2018-05-02T09:44:10Z","author_association":"CONTRIBUTOR","body":"Hi Luke,\r\n\r\nI've created an addin for a customer and we ran into an issue when two of our addins are loaded at the same time. SolidDna is called for each addin, but the first addin to load is loaded twice.\r\n\r\nI think this happens because PluginIntegration.PlugInFolder is set to typeof(PlugInIntegration).CodeBaseNormalized(); and only a single SolidDna DLL is loaded. It then finds the same code base twice and continues loading the first addin twice.\r\n\r\nHow can we prevent this? Can we pass the location of the plugin in a constructor somewhere?\r\n\r\nI'll create a second SolidDna DLL with a different name for now."},"comment":{"url":"https://api.github.com/repos/angelsix/solidworks-api/issues/comments/385923730","html_url":"https://github.com/angelsix/solidworks-api/issues/25#issuecomment-385923730","issue_url":"https://api.github.com/repos/angelsix/solidworks-api/issues/25","id":385923730,"user":{"login":"angelsix","id":4455939,"avatar_url":"https://avatars0.githubusercontent.com/u/4455939?v=4","gravatar_id":"","url":"https://api.github.com/users/angelsix","html_url":"https://github.com/angelsix","followers_url":"https://api.github.com/users/angelsix/followers","following_url":"https://api.github.com/users/angelsix/following{/other_user}","gists_url":"https://api.github.com/users/angelsix/gists{/gist_id}","starred_url":"https://api.github.com/users/angelsix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angelsix/subscriptions","organizations_url":"https://api.github.com/users/angelsix/orgs","repos_url":"https://api.github.com/users/angelsix/repos","events_url":"https://api.github.com/users/angelsix/events{/privacy}","received_events_url":"https://api.github.com/users/angelsix/received_events","type":"User","site_admin":false},"created_at":"2018-05-02T09:47:32Z","updated_at":"2018-05-02T09:47:32Z","author_association":"OWNER","body":"Oh and the fix to using the PluginFolder to find your current folder I fixed with the extension helper I made here https://github.com/angelsix/solidworks-api/commit/de86a19f3c8144f2e8563b19dc0b90b73c159bbe#diff-7be263e76e0501a832399212932e34d6R16 so you can call `this.AssemblyPath()` to get the path to the assembly where the class you are in is located, and you use it like this\r\n\r\n```\r\npublic override void ConnectedToSolidWorks()\r\n{\r\n    _taskPane = new TaskpaneIntegration<TaskPaneHost2>\r\n    {\r\n        Icon = Path.Combine(this.AssemblyPath(), \"ImageTwo.png\"),\r\n        WpfControl = new TaskPaneWindow2()\r\n    };\r\n\r\n    _taskPane.AddToTaskpane();\r\n}\r\n```"}}
{"actor":{"display_login":"angelsix"}}