Activation Context For AddInProcess.exe RRS feed

  • Question

  • I'm automating an application through the Microsoft Add-in Framework, and I'm wondering if it is possible set change the Activation Context on the AddinProcess.exe that is loading my Add-In?

    User.Exe -> AddInProcess -> Automation.AddIn.DLL(Currently using the activation context api) -> AssemblyForAutomation

    As long as I create threads in the AssemblyForAutomation everything is fine and they are run in the proper context and all of the SxS and com stuff works.

    The problem is I can not use the ThreadPool reliably because it does not seem to know about the activation context(which makes sense because it belongs to AddinProces). If I could change the ActivationContext on the AddInProcess.exe, I would not need to do it in my DLL and I could presumably use the Threadpool freely? Is there anyway to do this?


    Bob B.



    Tuesday, March 1, 2011 4:29 PM

All replies

  • As far as I know, activation context is associated with thread, not process, so you may need to set the context again in you threadpool worker method.
    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by eryang Tuesday, March 15, 2011 3:08 AM
    • Unmarked as answer by RBolkus Wednesday, April 11, 2012 5:37 PM
    Monday, March 7, 2011 10:37 AM
  •  I would agree with you and activating this way works (in the worker method). It does appear that the activation context is inhereted for all threadpool and background threads if an application manifest is provided.

    The problem is when run via automation I can not supply a manifest at launch as the main program is the AddInProcess.

    In my main thread I do set the activation context which all subsequent threads inherit, with the exception of threadpool and backgroundworkers. Yes I can force them by changing the context in the work routines and this works but I wonder if there isnt away to supply a manifest for loading AddInProcess which would just force them to inherit the proper context by default?

    Wednesday, April 11, 2012 5:35 PM