.net-4.0 - 如何检查方法是否已内联?

标签 .net-4.0 .net-4.5

我刚刚读了一篇博客,上面写着“......之前由于其他标准而无法内联的方法仍然没有内联。我检查了以下内容,这些方法都没有内联......”

我无法联系到作者,而且我认为它对 SO 用户也可能很有趣。所以我想问:

你如何检查一个方法是否真的被内联(或没有)?

最佳答案

This blog关于内联状态的条目,以及其他有趣的事情:

Steven did this by throwing an exception and then programmatically inspecting the stack trace associated with the exception. This makes sense when you are trying to automate the analysis, but for simple one-off cases, it is simpler and more powerful to simply look at the native instructions. See this blog for details on how to using Visual Studio.



即:显然对于休闲研究,只需阅读实际执行的内容就是要走的路。

关于.net-4.0 - 如何检查方法是否已内联?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11070350/

相关文章:

c# - 关于线程池最大线程的说明

c# - 复制文件时服务器变慢

c# - 最小起订量是触发代码契约(Contract)?

c# - 如何在运行时读取给定项目中的 MSBuild 属性?

c# - 正则表达式只匹配不以 ")"结尾的字符串

security - .NET 4.0 客户端证书验证错误

c# - 如何在 C# 中将日期时间转换为日期

c# - 使用 HttpClient.GetAsync() 时如何确定 404 响应状态

.net - Entity Framework 代码优先 : One-to-One where PK is a FK

.net-4.5 - 从 .Net 4.5 控制台应用程序对 AD FS 进行身份验证