一般都是在调试时使用SOS.dll,现在我想编程调用,发现里面有很多导出函数,像ClrStack,DumpIL之类的,但是苦于没有SDK和头文件,不知道这些函数的参数和返回值是怎样的,哪位有帮助文档或者头文件?注意:我说的是在代码中用DllImport去调用,不是调试的时候在即时窗口中使用

解决方案 »

  1.   

    SOS is an extension for WinDbg that allows you to debug managed code. SOS adds many commands to WinDbg, all of which are focused on debugging managed applications and many are ASP.NET-specific. The extension is a DLL file called Sos.dll, and it's located in the Clr10 folder in the folder where the Debugging Tools for Windows are installed.To load the SOS extension, type the following command at the command prompt in WinDbg: 
    .load clr10\sos
    Don't skip the period at the beginning of the command! If all goes well, you'll be taken back to the command prompt. If an error occurs, make sure that you have the latest version of the Debugging Tools for Windows installed. 根据Framework的版本不同,可在不同版本的framework目录下找到sos.dll文件:
    例如:C:\Windows\Microsoft.NET\Framework\v2.0.50727 ---------------------确实棘手找了段英文LZ看看,顺便我也研究下
      

  2.   

    反编的时候提示不是一个有效的程序集或com组件,不包含CLR头,估计DllImport 没戏了!
      

  3.   

    老大,你就也。难道你以为你平时能用DllImport的dll含有CLR头?DllImport那些DLL本来就没有CLR头。