Search code examples
c#clrmd

CLRMD Architecture MisMatch


I am working on CLRMD library and trying to load a dump. I am getting Mismatched architecture between this process and the dac. Console applicatin which is x86 application which creates a string array.

static void Main(string[] args)
    {
        string[] strArray = null;

        for (int i = 0; i < 100; i++)
        {
            strArray = new string[100];
            strArray[i] = "One";
            System.Threading.Thread.Sleep(1000);
            Console.WriteLine(i); 
        }

        Console.Read();
    }

I used 32Bit TaskManager to create a dump and when I load the dump I get the Architecture mismatch error.

enter image description here

dataTarget.Architecture is Amd64 and PointerSize 8.

enter image description here

But When same application process is attached, dataTarget.Architecture is x86 and Pointersize is 4.

enter image description here

Don't know when this difference. am I missing something when I am taking the dump. Please let me know how to load the dump into CLRMD

thanks in advance.


Solution

  • It is a very straight-forward mismatch, your program runs as a 32-bit process but the minidump was created from a 64-bit process. The DAC does not support mixing.

    You have to remove the jitter forcing so your program runs as a 64-bit process as well. Project > Properties > Build tab, change the Platform target setting to AnyCPU and untick the "Prefer 32-bit" checkbox. Repeat for the Release configuration.

    Do note that the solution platform name is not relevant to this setting, a possible reason your test console app turned out to be a 64-bit process even though you thought it targeted x86. You can double-check with Task Manager, Details tab, add the "Platform" column.