none
Failed to debug C# application developed and compiled in .net 3.5 but targeted to .net 4.0 and 3.5 using windebug RRS feed

  • Question

  • Failed to debug C# application in a host having both .net 4.0 and 3.5 using windebug. This application was developed and compiled in .net 3.5 environment but targeted to .net 4.0 and 3.5 using windebug.

    Any suggestions on this?

    Monday, April 22, 2013 1:08 PM

All replies

  • Hi Jbp,

    What kind of failure?

    The command doesn't work? It doesn't get your the expected result?

    Please make it more specific.

    Thanks.


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 23, 2013 10:04 AM
    Moderator
  • 0:000> .loadby sos clr
    Unable to find module 'clr'

    The above error is seen when tried to load SOS in the envornment having .net 4.0 and .net 3.5 installed.

    Wednesday, April 24, 2013 6:18 AM
  • Hi Jbp,

    And here is another thread on this topic: http://social.msdn.microsoft.com/Forums/en-US/clr/thread/59aa78c9-dc05-43c8-9efe-e7b132056afc

    Launch XXXXXX.exe from WinDbg, and then input "g" command to let debuggee process to run, after receive output "Welcome to Advanced .NET Debugging!" from 02Sample.exe, back to WinDbg, press Ctrl + Break, and then input command ".loadby sos clr" to load sos extension.

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Thursday, April 25, 2013 12:18 PM
    Moderator
  • Then how can we debug in this case?

    Please provide some solution for this otherwise we cannot debug managed code.

    • Edited by jbp11787 Monday, April 29, 2013 1:58 PM
    Monday, April 29, 2013 11:49 AM
  • Hi Jbp,

    I have modified my above post, would you like to check it again.

    Thanks.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 1, 2013 2:49 PM
    Moderator
  • Hi Mike,

    Thanks for your reply.

    Loaded clr using the command

    .loadby sos clr

    But still I am unable to debug it. Observed the following error messages:

    0:009> !threads
    Failed to load data access DLL, 0x80004005
    Verify that 1) you have a recent build of the debugger (6.2.14 or newer)
                2) the file mscordacwks.dll that matches your version of clr.dll is
                    in the version directory
                3) or, if you are debugging a dump file, verify that the file
                    mscordacwks_<arch>_<arch>_<version>.dll is on your symbol path.
                4) you are debugging on the same architecture as the dump file.
                    For example, an IA64 dump file must be debugged on an IA64
                    machine.

    You can also run the debugger command .cordll to control the debugger's
    load of mscordacwks.dll.  .cordll -ve -u -l will do a verbose reload.
    If that succeeds, the SOS command should work on retry.

    If you are debugging a minidump, you need to make sure that your executable
    path is pointing to clr.dll as well.


    • Edited by jbp11787 Tuesday, May 14, 2013 9:24 AM
    Tuesday, May 14, 2013 9:23 AM
  • .Net 3.5 and 4.0 are very different from each other. I think some of your .Net 4.0 code domains can not reach some domains that it has been reached in .net 3.5 environment.

    This maybe a tip Just i want to say


    Hamit YILDIRIM

    Wednesday, May 29, 2013 8:50 AM
  • Hi Jbp11787:

    Questions:

    1. how do you target .NET 4.0/3.5 in Windbg to debug your C# application? In my experience, we just make the application to target specific .NET run time in configuration file. I don't hear who target the Runtime in Windgb?

    2. Whether you can run that app at first, then to attach Windbg to that application. 

    Maybe you just need to use .NET 2.0 to debug your app in this scenario if you don't modify configuration to target .Net 4.0 runtime. 



    Best regards,
    Riquel

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 29, 2013 7:11 PM
  • You need to pull the specific version of mscordacwks.dll pulled from the machine where the dump was taken. After you pull this dll, rename it to the "WinDBG" friendly formatted name and put into one of the folders in symbol path. You should be able to run SOS extensions.

    Hope this helps!



    Wednesday, June 5, 2013 2:07 AM