我们刚刚将测试站从Windows XP切换到Windows 7,出现意外问题。
我们使用NUnit 2.5.9运行测试,在Windows XP上运行期间,我们收到来自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)
并弹出以下错误消息窗口:
但测试仍在运行并成功完成。
现在切换到Windows 7,我们将这些警告视为错误:
[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).
出现相同的错误消息,测试停止正在运行。
到目前为止,我发现的简短解决方法就是关闭此错误窗口并继续运行测试
我想知道是否有办法在TeamCity测试配置或任何其他正确的解决方法中以某种方式捕获此异常?
感谢