visual-studio - 在 Visual Studio 2013 测试代理上使用 Shims 运行测试

标签 visual-studio unit-testing visual-studio-2013 microsoft-fakes

我在许多网站上发现了这个问题的各种迭代,但是到目前为止,我还没有找到任何提供完整答案的内容。
我刚刚设置了一些 Visual Studio 测试代理,它们似乎都在运行并运行我们最初计划在它们上运行的大部分单元测试。但是,当我开始检查其中一个单元测试时,它在线上失败了:using (ShimsContext.Create()) ,
使用堆栈跟踪: Result Message:
Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: Failed to resolve profiler path from COR_PROFILER_PATH and COR_PROFILER environment variables.
阅读了其他一些帖子后,我在测试代理上安装了 Visual Studio 2013 并确认它可以在本地运行测试。然后我将 COR_PROFILER_PATH 设置为我的机器上正在使用的分析器,该分析器安装在:“C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\12.0.0\Microsoft.IntelliTrace.Profiler .12.0.0.dll”。
然后它在与跟踪相同的地方失败: Test method threw exception:
Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: Failed to get profiler module handle 'C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\12.0.0\Microsoft.IntelliTrace.Profiler.12.0.0.dll'. The specified module could not be found ---> System.ComponentModel.Win32Exception: The specified module could not be found

建议是探查器已在单独的进程下加载,无法使用。有没有人在这个或类似的设置上取得过任何成功?在基本层面上,Visual Studio 测试代理可以使用 Fakes 运行测试吗?
谢谢

最佳答案

我知道这有点旧,所以 OP 可能得到了他的答案,但是对于其他任何人,我就这个问题向 Microsoft 开了一张票,经过一个半小时的查看我的设置后,我们得出了答案问题:

Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException:无法从 COR_PROFILER_PATH 和 COR_PROFILER 环境变量解析探查器路径。

, 是我在使用 mstest.exe 我应该一直使用 vstest.console.exe .就我而言,这是因为我现在的代码中有 Fakes 测试。

我正在使用 Visual Studio 2013 更新 4。

关于visual-studio - 在 Visual Studio 2013 测试代理上使用 Shims 运行测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26743342/

相关文章:

visual-studio - VS 模板不安装 Nuget 包

visual-studio-2013 - Visual Studio 2013 : auto-refresh solution explorer in "show all files" mode

c# - 在 NHibernate 环境中创建数据驱动的单元测试

c++ - 在一个 makefile 中生成多个构建

java - 在 Java 中使用 AspectJ 进行单元测试

c# - nuget.org 上的源无法访问?

asp.net - AllowOnlyAlphanumericUserNames - 如何设置? (RC 到 RTM 重大更改)ASP.NET Identity

c++ - MFC 应用程序在 CRecentFileList::Add 命令行 FileOpen 处断言失败

c++ - 使用 Microsoft Visual C++ 2010 Express 时出现链接错误 LNK1123

c# - 如何将已发布的 Web 应用程序从 azure 导入到 Visual Studio for Web