I have a Visual Studio 2008 unit test project that depends on a dll project in the same solution. With this setup, I want to profile a single unit test with a Visual Studio performance session. Said test calls into methods located in the dll project and I want to see where the perf bottleneck is in that dll.

到目前为止,一切都很好。起初看起来很简单:在 Visual Studio 测试视图中,我右键单击相关测试并选择“创建性能会话...”。在接下来的向导中,我选择了 instrumentation。但是,在运行生成的性能会话之后,仅显示位于单元测试 dll 中的方法的数据。然后我右键单击 perf 会话中的“Targets”文件夹并选择“Add Target Binary...”来添加 dll(我选择了 dll 项目文件夹中 bin/release 下的 dll)。这是有效的,因为现在也检测了 dll,但我一直缺少该 dll 中方法的性能数据。我试图从不同的位置添加 dll ...

  • dll工程文件夹下的bin/release
  • dll项目文件夹下的obj/release
  • 单元测试dll项目文件夹下的bin/release

...都没有用。

I'd appreciate feedback on how to gather perf data of the dependent dll.


我遇到了与您完全相同的问题,但我可以像您一样解决添加目标的问题,但有一个细微差别:我选择了“添加目标项目”而不是“添加目标二进制文件”。然后它工作正常。

可能是您选择的二进制文件有问题,也可能是 VS2008 中的错误。如果可能的话,我建议您将您尝试分析的二进制文件添加为解决方案中的项目。

希望这可以帮助。


感谢您的回答。我最终编译了一个调用 dll 的新 exe。也有效,但当然比你建议的更麻烦。当我有时间做更多的分析时,我会尝试你的建议。

微信小程序

微信扫一扫体验

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部