Skip to content
This repository was archived by the owner on Apr 21, 2021. It is now read-only.

Unit Testing frameworks report System.AppDomainUnloadedException #8

@JavierJF

Description

@JavierJF

In all the situations I have try to use the MouseWatcher inside a unit test, the testing framework (NUnit, xUnit) reports a this exception:

System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.

First guess is that, calling MouseWatcher.Stop(), doesn't stop all the running threads that it should.

I have tried:

  1. To isolate the call in it's own thread, and get the dispatcher to invoke the stop inside, and them abort the thread.
  2. To give that thread STA Apartment State, and the IsBackground property.

Nothing has worked yet. At the moment you call MouseWatcher.Start() you get the cited exception at the end of the test.

Thanks you.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions