none
System.InvalidOperationException @64 Bit; Managed Debugging? RRS feed

  • Question

  • Hi there,

    I'm new to this forum and first of all I've to admit, that I'm pretty beginner in .net development.
    Nevertheless I hope some of you is patient enougth to help me. ;-)

     

    Let's come to my trouble:

    I use an assembly (exe) which was developed by someone in 2007 for .net 2.0.
    It works perfect on Windows 7 32 bit.
    On 64 bit however it throws the (not much enlightening) error:

    CLR20r3
    System.InvalidOperationException

     

    Since the guy, who developed this application isn't available anymore, I need to help myself.

    With Mdbg.exe (v4.0) - installed with Visual Studio 2010 express on my W7-64 bit -  I've tried to figure out some details about the crash.

    Unfortunately mdbg.exe issues an error: the debugger and the debuggee are on different platforms.
    I could not find any solution for this with google or in MSDN.
    Seems that I am the only one with this trouble.

     

    Hence some questions:

    1) How can I find out more details about the cause for the crash?

    2) Would it help to dis- and re-assemble (ildasm.exe and ilasm.exe) the assembly with the 64-Bit-Flag to make it run on 64-bit-system?

    3) Does it simply help to switch the cpu-flag with CorFlags.exe? Unfortunately that tool isn't part of the VS 2010 express package.

    4) I saw that the Visual Basic compiler has a /platform switch. It determines, whether the assembly runs in 64-bit-'layer' or in WOW64.
    Since I have no source code i cannot compile the application. But is there a tool, that achieve this with the already compiled/assembled program?

     

    Many thanks in advance!
    And sorry for the possibly silly questions.

    Regards,
    Michael

    Wednesday, July 21, 2010 2:54 PM

Answers

  • Hi,

      Thanks for your post.

      For InvalidOperationException, please take a look at Troubleshooting Exceptions: System.InvalidOperationException.

      For cross-platform debugging, please take a look at MDbg, Managed-debugging, and 64 bit. It addresses the problem of your debugger and debuggee are of different platforms. 

      If the application needs to run on 64bit platform and we don't have source code, we could decompile it with ildasm.exe. And then use the ilasm.exe /x64 to re-compile it. And then use the corflags.exe to configure the CorFlags section of the header of the portable executable image properly. Please refer to the following steps:

      (Suppose the 32bit application name is App32.exe.)

      1. ildasm App32.exe /out=output.il (get the IL code)

      2. ilasm output.il /x64 /out=App64.exe (compile it to x64)

      3. corflags /32bit- App64.exe (clear the 32bit flag)


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Edited by SamAgain Monday, July 26, 2010 10:06 AM refine
    • Marked as answer by SamAgain Thursday, July 29, 2010 10:06 AM
    Monday, July 26, 2010 10:02 AM

All replies

  • Hi,

      Thanks for your post.

      For InvalidOperationException, please take a look at Troubleshooting Exceptions: System.InvalidOperationException.

      For cross-platform debugging, please take a look at MDbg, Managed-debugging, and 64 bit. It addresses the problem of your debugger and debuggee are of different platforms. 

      If the application needs to run on 64bit platform and we don't have source code, we could decompile it with ildasm.exe. And then use the ilasm.exe /x64 to re-compile it. And then use the corflags.exe to configure the CorFlags section of the header of the portable executable image properly. Please refer to the following steps:

      (Suppose the 32bit application name is App32.exe.)

      1. ildasm App32.exe /out=output.il (get the IL code)

      2. ilasm output.il /x64 /out=App64.exe (compile it to x64)

      3. corflags /32bit- App64.exe (clear the 32bit flag)


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Edited by SamAgain Monday, July 26, 2010 10:06 AM refine
    • Marked as answer by SamAgain Thursday, July 29, 2010 10:06 AM
    Monday, July 26, 2010 10:02 AM
  • We temporarily mark a reply, please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Please mark the right answer at right time.
    Thanks,
    Sam
    Thursday, July 29, 2010 10:06 AM