【问题标题】:How can I load SOS in Visual Studio 2017 in Immediate Window in C#?如何在 C# 的即时窗口中加载 Visual Studio 2017 中的 SOS?
【发布时间】:2019-07-26 15:33:53
【问题描述】:

我试过这个:

    1. Create new Windows WinForm Desktop Application in VS2017. (or console)
    2. Build it and Run as Admin.
    3. Enable Native Debugging, Enable Managed compatibility mode
    4. Pause App by Break All, or break in an breakpoint
    5. Open Immediate Windows and type command:

.load SOS

错误 CS1525:无效的表达式术语“。”

或 .loadby 或 !load 或 load 或 .Load 等。

根据文章

https://blogs.msdn.microsoft.com/vijaysk/2007/11/15/sos-your-visual-studio/

【问题讨论】:

  • VS2010 是最后一个仍然可以做到这一点的 VS 版本。你需要使用windbg。
  • 为什么为 VS 删除了 SOS。这很奇怪。他们可能会替换它或被某些设置保护。 SOS 是网络运输的一部分
  • SOS 仍然是 .NET 的一部分。与 WinDbg 一起使用。它将提供与 VS 中相同的输出。这不是太难。
  • 你可以试试免费的VisualSOS marketplace.visualstudio.com/…

标签: c# visual-studio-2017 windbg sos


【解决方案1】:

本主题中显示的过程要求您将 Windows 驱动程序工具包集成到 Visual Studio 中。要获得集成环境,首先安装 Microsoft Visual Studio,然后安装 Windows Driver Kit (WDK)。有关详细信息,请参阅 Windows 驱动程序开发。 在 Visual Studio 中,您可以在调试器即时窗口中输入调试器命令。要打开 Debugger Immediate 窗口,请从 Debug 菜单中选择 Windows>Immediate。

来源:https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/entering-debugger-commands-in-visual-studio

【讨论】:

  • 您通过docs.microsoft.com/en-us/windows-hardware/drivers/debugger/… 的引用告诉我们什么?您是否还注意到“此功能在 Windows 10 版本 1507 及更高版本的 WDK 中不可用。”?
  • 我还有 Windows 8。所以它应该对我有用。安装 WDK 和即时 Windows 神奇地开始理解调试器命令。我会试试的
猜你喜欢
  • 1970-01-01
  • 2013-03-16
  • 1970-01-01
  • 1970-01-01
  • 2019-08-24
  • 1970-01-01
  • 2018-06-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多