如何检查.NET Core 2.1程序集是否以调试模式构建? [英] How to check if .NET Core 2.1 assembly is built in Debug mode?

查看:306
本文介绍了如何检查.NET Core 2.1程序集是否以调试模式构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将VS2019调试器附加到Azure耐用功能.尝试此操作时,我会收到一条消息,说明该功能已在发布模式下构建.但是,我的DevOps构建管道使用配置调试".

I have an Azure Durable Function that I'd like to attach VS2019 debugger to. When I try this I get a message that the function has been built in release mode. However, my DevOps build pipeline uses configuration 'Debug'.

我已经获取了所构建dll的副本.我怎么知道这真的是调试或发布dll?我已经在Telerik JustDecompile中打开了,但是看不到任何明显的迹象.

I have grabbed a copy of the dll that was built. How can I tell if this really is a debug or release dll? I've opened in Telerik JustDecompile but can't see any obvious indication.

推荐答案

dotnet core 2.1程序集如何知道是否调试?

dotnet core 2.1 assembly how to know if debug?

由于您可以获取所有dll文件,因此可以创建一个控制台应用程序,然后引用此/这些dll文件.调试此控制台应用程序,在调试模式(Debug-> Windows-> Modules)下打开 Modules 窗口:

Since you could get all the dll files, you could create a console application, then reference this/those dll file. Debugging this console application, open the Modules window under the debugging mode (Debug->Windows->Modules):

如您所见,有一个选项 Optimized (优化的),如果引用的dll是发行版dll,它将显示为Yes,否则,将显示为No.

As you can see, there is an option Optimized, if the referenced dll is a release dll, it will show as Yes, otherwise, it will show as No.

希望这会有所帮助.

这篇关于如何检查.NET Core 2.1程序集是否以调试模式构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆