Terry,
It shouldn’t be an issue for two processes to use the same
add-in assembly. One add-in can be
loaded and used by more than one process or multiple times in the same
process. Any process using the add-in
will lock it to editing, so the add-in could be loaded but it shouldn’t be
displayed in the IDE for editing.
Here’s the testing I did to ensure this, if I am missing
something please let me know. This
testing was done using the ShapeAppBasicCSharp unmodified load add-in method
which loads the add-in into a new app domain.
IEntryPoint addIn = addInToken[0].Activate<IEntryPoint>(AddInSecurityLevel.FullTrust);
Test multiple threads using the same add-in:
1)
1) Create an add-in:
Private Sub
AppAddIn_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup
System.Windows.Forms.MessageBox.Show("hello
world!")
AddHandler Me.ActiveDrawing.ShapeAdded,
New AddedEventHandler(AddressOf
ActiveDrawing_ShapeAdded)
End Sub
Private Sub
ActiveDrawing_ShapeAdded(ByVal sender As Object, ByVal e As
AddedEventArgs)
System.Windows.Forms.MessageBox.Show("shape
added! Number of shapes: " & Me.ActiveDrawing.Shapes.Count)
Dim shapeAdded As
IShape = CType(e.AddedItem, IShape)
shapeAdded.Color =
Application.CreateColor(System.Drawing.Color.SkyBlue.ToArgb())
End Sub
2)
2) Run two instances of the ShapeAppCSharp application
3)
3) Add a different number of shapes to each
instance of the ShapeAppCSharp application
Result: Message boxes were displayed showing the
correct number of shapes for each instance of the application with the add-in
loaded.
Hope this helps, please let me know if you have any
questions.
Thanks!
-Melody