在Visual Studio中启动单元测试非常慢,反复加载/卸载相同的dll

时间:2016-02-03 11:19:12

标签: unit-testing visual-studio-2013

问题

我在开始单元测试方面有严重的延迟(几分钟),如果我不调试它似乎并不重要。

调试时我可以在输出窗口看到有一个包被重复加载和重新卸载。这种情况发生了数千次。

'vstest.executionengine.x86.exe' (CLR v4.0.30319: Domain 929): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Tips.UnitTest.AssemblyResolver\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Tips.UnitTest.AssemblyResolver.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.TeamSystem.Licensing.dll'. Symbols loaded.
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Common\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Common.dll'. Symbols loaded.

'vstest.executionengine.x86.exe' (CLR v4.0.30319: Domain 929): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Unloaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Tips.UnitTest.AssemblyResolver\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Tips.UnitTest.AssemblyResolver.dll'
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Unloaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Common\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Common.dll'
'vstest.executionengine.x86.exe' (CLR v4.0.30319: Dependency finder domain): Unloaded 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.TeamSystem.Licensing.dll'

我试过......

  • 以管理员身份运行Visual Studio 2013。
  • 以下解决方案:https://stackoverflow.com/a/14115731/632336 (启用Just My Code& Load all Symbols),但是当我单击按钮时 加载所有符号Visual Studio只是崩溃。 (有时 立即,有时在装完后)
  • 启用/禁用Microsoft符号服务器,但没有 差。
  • 在启用日志记录的情况下启动Visual Studio但没有任何内容 这看似与众不同或与我的问题有关。
  • 从头开始创建一个新的空测试项目。同样的问题

2 个答案:

答案 0 :(得分:0)

我在开发箱中遇到了同样的问题。 我打开小提琴手,发现很多人都打电话给'symweb'。

所以,我创建了一个小提琴自动回复规则来放弃这些调用。 在此之后,开始测试之前的延迟减少到不到一秒钟。

enter image description here

答案 1 :(得分:0)

可能不是一个明确的答案,因为它适用于Visual Studio 2015,但它可能对某些人有帮助。

我们最近安装了一个" Microsoft ASP.NET和Web Tools"更新(通过扩展和更新),从那时起,单元测试的缓慢发现已经解决。而不是花大约2分钟来启动单个单元测试,现在只需几秒钟。

扩展程序已从版本14.1.11107.0更新为14.1.21111.0