Skip to content

Failed to unload app domain. #7936

Answered by yuvnith
yuvnith asked this question in Questions
Dec 27, 2023 · 3 comments · 5 replies
Discussion options

You must be logged in to vote

Yesterday, I was able to get around this by using the dispatcher from the Run() method rather than the ManagedBootstrapper constructor.

Old

        public ManagedBootstrapper(IEngine engine, IBootstrapperCommand command) : base(engine)
        { 
            //global variable
            ApplicationServices.BootstrapperDispatcher = Dispatcher.CurrentDispatcher;
        }

New

protected override void Run()
        {
           ApplicationServices.BootstrapperDispatcher = Dispatcher.CurrentDispatcher;
        }

This example follows the same approach.

The dispatcher from the constructor has an MTA apartment state, whereas the dispatcher from the run() has a STA apartment state. More analysi…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@yuvnith
Comment options

Comment options

You must be logged in to vote
4 replies
@robmen
Comment options

@MichaelCross5129
Comment options

@yuvnith
Comment options

Answer selected by yuvnith
@MichaelCross5129
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants