如何调试从netmodule生成的程序集 [英] How to debug the assembly generated from the netmodule

查看:68
本文介绍了如何调试从netmodule生成的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用CSC.exe任务生成了一个模块,并使用生成的"netmodule"中的AL.exe生成了具有不同名称的DLL。当我生成模块时,它生成了一个.pdb文件和netmodule。现在,我通过AL.exe使用相同的模块生成带有
不同名称的DLL。当我尝试调试从这个netmodule生成的DLL之一时,它无法调试为"Enable Just My Code"在我的代码中检查。所以,取消选中此项并尝试。它会调试。这里的问题是
,我的调试点正在点击,我可以查看所有代码行。当我将鼠标悬停在任何变量上时,它不会在变量上显示任何内容。当我用手表检查它时,它说"无法获得本地或参数的值,因为它不是这个指令指针可用的
,可能是因为它已被优化掉了。"我取消选中了优化标志,将调试设置为完全模式。没有用。如果有任何解决方案或解决方法可以解决此问题,请告诉我?

解决方案

嗨Rakesh Kumar Muthyala,


<你使用哪个VS版本?您真正调试了哪种应用程序?


>>"无法获取本地或参数的值,因为它在此指令指针处不可用,可能是因为它已经过优化。远"


(1)你是否真的在调试模式下调试你的应用程序(不是发布模式)?


(2)检查工具 - >选项 - >调试 - >使用托管兼容模式。


(3)检查工具 - >选项 - >调试 - > General->抑制模块加载时的JIT优化(仅限管理)。


(4)"启用非托管/本机代码调试"或启用"Visual Studio托管过程"在项目属性下 - >调试,如果它是一般的C#项目。


再次调试。


最好的问候,


杰克


Hi, I have generated a module using CSC.exe task and generated DLLs with different names using AL.exe from the generated "netmodule". When i generated the module, it generated a .pdb file along with netmodule. Now, I  am generating DLL with different names using same module through AL.exe. When i try to debug one of the DLL generated from this netmodule, it is unable to debug as "Enable Just My Code" is checked in my code. So, uncheck this and try. It will debug. The problem here is that, My debug point is hitting and I can go through all lines of code. When I mouse over any variable, it is not showing up anything on the variable. When i checked it with the watch, It is saying "Cannot obtain value of local or argument, as it is not available at this instruction pointer, possibly because it has been optimized away." I have unchecked the optimize flag, set the debug to full mode. None works. Please let me know if there is any solution or workaround to resolve this issue?

解决方案

Hi Rakesh Kumar Muthyala,

Which VS version did you use? Which kind of app did you really debug?

>>"Cannot obtain value of local or argument, as it is not available at this instruction pointer, possibly because it has been optimized away."

(1)Do you really debug your app in debug mode(not release mode)?

(2)Check Tools -> Options -> Debugging -> Use Managed Compatibility Mode.

(3)Check Tools -> Options -> Debugging->General->Suppress JIT optimization on module load (Managed only).

(4)"Enable unmanaged/native code debugging" or enable "Visual Studio Hosting process" under project property->Debug if it was the general C# project.

Debug it again.

Best Regards,

Jack


这篇关于如何调试从netmodule生成的程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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