C# 有人知道输出“模块已优化且调试器选项‘仅我的代码’已启用”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13528952/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 08:55:15  来源:igfitidea点击:

Does anybody know about the output "Module is optimized and the debugger option 'Just My Code' is Enabled"?

c#microsoft-metro

提问by Gopinath Perumal

As I said in my previousquestion I'm migrating my app to windows Metro app.

正如我在上一个问题中所说,我正在将我的应用程序迁移到 Windows Metro 应用程序。

I'm getting an output like thisenter image description here

我得到这样的输出在此处输入图片说明

I don't understand this output, if anybody knows then this please say!

我不明白这个输出,如果有人知道,请说!

回答by Yennefer

When you run your application in the debugger, the debugger tries to locate the symbols of the code being run in order to allow you to set break points, view/change memory, examining the call stack etc...

当您在调试器中运行应用程序时,调试器会尝试定位正在运行的代码的符号,以便您可以设置断点、查看/更改内存、检查调用堆栈等...

As this task can introduce unwanted delays and/or could confuse the user under normal circumstances, Visual Studio is configured by default to skip the assemblies not being part of your solution. This is normally fine as you can focus on your code. However, there are case which you need to dig under your code to spot bugs not related to your code.

由于此任务在正常情况下会引入不必要的延迟和/或可能使用户感到困惑,因此默认情况下将 Visual Studio 配置为跳过不属于您的解决方案的程序集。这通常很好,因为您可以专注于您的代码。但是,在某些情况下,您需要挖掘代码以发现与代码无关的错误。

For this reason, the debugger is remembering you that the symbol is being skipped due to this setting, and the picture your are seeing is imcomplete as does not take into acccount what is not "yours".

出于这个原因,调试器会记住您由于此设置而跳过了符号,并且您看到的图片不完整,因为没有考虑到不是“您的”的东西。

You can disable this behaviour by unchecking the option Enable Just My Codeunder Tools->Options->Debugging.

您可以通过取消选中Tools->Options->Debugging下的Enable Just My Code选项来禁用此行为。

Moreover, if you are interested in stepping through the .NET Framework code, you have to set the Enable .NET Framework source steppingoption. Setting this option, also unsets the Enable Just My Code.

此外,如果您对单步执行 .NET Framework 代码感兴趣,则必须设置启用 .NET Framework 源单步执行选项。设置此选项也会取消设置Enable Just My Code

回答by Istvan Heckl

Usually, you do not need the module load messages, but they are turned on in default.

通常,您不需要模块加载消息,但默认情况下它们是打开的。

Tools -> Options -> Debugging -> Output Window -> Module Load Messages -> Off

工具 -> 选项 -> 调试 -> 输出窗口 -> 模块加载消息 -> 关闭

回答by Rutul Patel

you could start the application without the debugger attached by pressing Ctrl+F5 from within the Visual Studio environment

您可以通过在 Visual Studio 环境中按 Ctrl+F5 来启动没有附加调试器的应用程序

this not a error. you only release debugging process from it.

这不是错误。你只能从中释放调试过程。