I'm writing a unit test that returns a List<T>
from a MySql database. I'm getting an the following error:
System.CannotUnloadAppDomainException: Error while unloading appdomain. (Exception from HRESULT: 0x80131015)
I've determined that it is because of the MySQL connection. I have the MySqlConnection in a using block as well as the MySqlCommand and MySqlDataReader. I'm guessing that the garbage collector hasn't disposed of them in memory and that's why I'm getting the error.
Any suggestions?
Thanks.
User contributions licensed under CC BY-SA 3.0