We just switched our test station from Windows XP to Windows 7 and unexpected problem appeared.
We run tests using NUnit 2.5.9 and at some point during running on Windows XP we were getting warnings from TeamCity:
[16:05:27][Step 2/16] 2013-09-20 16:05:28,181 [watchDog] WARN JetBrains.Container.Log4netDefaultLoggerInitializer - Unhandled exception in current domain: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain., , (null)
[16:05:27][Step 2/16] 2013-09-20 16:05:28,181 [1232] WARN JetBrains.Container.Log4netDefaultLoggerInitializer - Unhandled exception in current domain: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain., , (null)
[16:05:27][Step 2/16] 2013-09-20 16:05:28,181 [2684] WARN JetBrains.Container.Log4netDefaultLoggerInitializer - Unhandled exception in current domain: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain., , (null)
[16:05:27][Step 2/16] 2013-09-20 16:05:28,181 [5940] WARN JetBrains.Container.Log4netDefaultLoggerInitializer - Unhandled exception in current domain: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain., , (null)
[16:05:27][Step 2/16] 2013-09-20 16:05:28,181 [2724] WARN JetBrains.Container.Log4netDefaultLoggerInitializer - Unhandled exception in current domain: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain., , (null)
and the following error message window popped up:

but tests were still running and finishing successfully.
Right now with switching to Windows 7, we are getting those warnings as errors:
[10:48:31][Step 2/16] 2013-09-30 10:48:30,862 [watchDog] WARN JetBrains.Container.Log4netDefaultLoggerInitializer - Unhandled exception in current domain: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain., , (null)
[10:48:31][Step 2/16]
[10:48:31][Step 2/16] 2013-09-30 10:48:30,862 [564] WARN JetBrains.Container.Log4netDefaultLoggerInitializer - Unhandled exception in current domain: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain., , (null)
[10:48:31][Step 2/16] Unhandled Exception: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
[10:48:31][Step 2/16] 2013-09-30 10:48:30,862 [5088] WARN JetBrains.Container.Log4netDefaultLoggerInitializer - Unhandled exception in current domain: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain., , (null)
[10:48:31][Step 2/16]
[10:48:31][Step 2/16] 2013-09-30 10:48:30,865 [5840] WARN JetBrains.Container.Log4netDefaultLoggerInitializer - Unhandled exception in current domain: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain., , (null)
[10:48:31][Step 2/16] Unhandled Exception: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
[10:48:31][Step 2/16] 2013-09-30 10:48:30,866 [4004] WARN JetBrains.Container.Log4netDefaultLoggerInitializer - Unhandled exception in current domain: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain., , (null).
The same Error message appears and tests are stop running.
The short workaround I found so far is just to close this error window and test are continue to run.
I am wondering if there is a way to catch this exception somehow in TeamCity test configuration, or any other proper workaround?
Thanks