正如我在上一个问题中所说,我正在将我的应用程序迁移到 Windows Metro 应用程序。
我得到这样的输出
我不明白这个输出,如果有人知道,请说!
通常,您不需要模块加载消息,但默认情况下它们是打开的。
工具 -> 选项 -> 调试 -> 输出窗口 -> 模块加载消息 -> 关闭
当您在调试器中运行应用程序时,调试器会尝试定位正在运行的代码的符号,以便您设置断点、查看/更改内存、检查调用堆栈等...
由于此任务可能会引入不必要的延迟和/或在正常情况下可能使用户感到困惑,因此默认情况下将 Visual Studio 配置为跳过不属于您的解决方案的程序集。这通常很好,因为您可以专注于您的代码。但是,在某些情况下,您需要深入研究代码以发现与您的代码无关的错误。
出于这个原因,调试器会记住您由于此设置而跳过了符号,并且您看到的图片不完整,因为没有考虑到不是“您的”的图片。
您可以通过取消选中Tools->Options->Debugging下的Enable Just My Code选项来禁用此行为。
此外,如果您对单步执行 .NET Framework 代码感兴趣,则必须设置启用 .NET Framework 源单步执行选项。设置此选项也会取消设置Enable Just My Code。
您可以在没有附加调试器的情况下启动应用程序,方法是在 Visual Studio 环境中按 Ctrl+F5
这不是错误。您只能从中释放调试过程。
在 VS Code 中,如果您不想禁用“仅我的代码”(因为您可以只调试自己的代码),那么您可以通过将其添加到配置中来摆脱这些消息launch.json
:
"logging": {
"moduleLoad": false
}
另一方面,如果您真的想调试外部代码,请将其添加到您的launch.json
配置中:
"justMyCode": false
launch.json
在下面找到用于调试您自己的代码的完整示例配置:
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/YourProject/bin/Debug/netcoreapp3.1/YourProject.dll",
"args": [],
"cwd": "${workspaceFolder}/src/YourProject",
"stopAtEntry": false,
"justMyCode": true, // You can change to false if you wanna debug 3rd-party code
"logging": {
"moduleLoad": false
},
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
}