Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mdbg can't debug my hello world program

Tags:

c#

debugging

mdbg

In order to try out mdbg, I have the following simple hello world program:

// kkk.cs
using System;

class HelloMain
{
    static public void Main()
    {
        Console.WriteLine("Hello");
    }
}

Compile it with csc /debug kkk.cs, this yields:

kkk.exe
kkk.pdb

I then do (from the visual studio command line):

mdbg kkk.exe

or

mdbg !r kkk.exe

I got:

Error: The request is not supported. (Exception from HRESULT: 0x80070032)
like image 480
user469591 Avatar asked Oct 07 '10 20:10

user469591


2 Answers

I know this question is super old, but I just ran into this and found the 'fix' for this problem. Adding here for any other Googlers..

I have two directories:

  • C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools\Mdbg.exe
  • C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools\x64\Mdbg.exe

Make sure you're launching the correct version (in my case, the x64 version) and doing a 'Run as Administrator' when opening the command prompt.

like image 149
mpeterson Avatar answered Oct 09 '22 07:10

mpeterson


Try csc /debug /platform:x86 kkk.cs

You're running on 64-bit Windows. Mdbg is a 32-bit process and can only debug 32-bit processes.

like image 31
Tergiver Avatar answered Oct 09 '22 06:10

Tergiver