Strange MMP0000: CLR_E_FAIL when building Glide

I am porting an old project to TinyCLR, but need to build the old .NETMF one. I have set up a .NETMF v4.3 dev environment on a fresh install of Windows 10, using some of the guidance from Dat_Tran here. It is mostly working, as I can open .NETMF projects in VS 2015. Some of the projects build, but one that doesn’t that the rest of my solution depends on is Glide. I made some changes to the source many years ago, but even if I remove any changes I made by checking out a commit before I did anything, like “a170cee0 - Commit for SDK release 2015.1.10.0”, it doesn’t work. I’m wondering if anyone with access to the Glide source code and a working .NETMF environment can try it an maybe help me?

The error message is one of those unhelpful “CLR_E_FAIL” messages from MMP. Interestingly though it also gives an error in Keyboard.cs - “Cannot parse method signature ‘Render’”.

I set the MSBuild output verbosity up to “Diagnostic” and below are the interesting lines, which indicate that it is illegal to get an element from an array, which I know is not true. I think this is just some kind of misconfiguration, but I have not been able to figure out what is wrong.

1> C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Tools\MetaDataProcessor.exe -loadHints Microsoft.SPOT.Graphics …
1> Method: GHI.Glide.UI.Keyboard::Render (TaskId:35)
1> 000000BB ldelem – Not supported (TaskId:35)
1>C:\Users\user\Desktop\Repositories\Glide\Glide\UI\Keyboard\Keyboard.cs(86,9,86,10): error MMP0000: Cannot parse method signature ‘Render’
1>MMP : error MMP0000: CLR_E_FAIL
1> The command exited with code 10. (TaskId:35)
1>Done executing task “MetaDataProcessor” – FAILED. (TaskId:35)

The “Render” method is:

/// <summary>
/// Renders the Keyboard onto it's parent container's graphics.
/// </summary>
public override void Render()
{
	int x = Parent.X + X;
	int y = Parent.Y + Y;

	Parent.Graphics.DrawRectangle(0, 0, x, y, Glide.LCD.Width, Height, 0, 0, Colors.DarkGray, 0, 0, 0, 0, 0, 255);
	Parent.Graphics.DrawImage(_bitmapX, y, BitmapUp[_bitmapIndex], 0, 0, Width, Height);

	for (int i = 0; i < _keyActive.Length; i++)
	{
		if (!_keyActive[i])
			Parent.Graphics.DrawRectangle(_keyCoords[i], Colors.DarkGray, 200);
	}
}

It might be VS project problem. Start a new project and add things gradually to it. This is how I would do it.

Thanks, I’m working on doing that. Do you think it would work better in VS 2013? I first tried 2019, then was just barely able to find an ISO of 2015 to try that. Do you know where I could still get 2013 Community?

I started a new “Micro Framework>Class Library” solution in VS2015 Community. In the “Class1.cs” file that it starts you with, I added the following to test the ldelem instruction:

    static void Test()
    {
        int[] numbers = { 1, 2, 3, 4, 5 };
        int index = 2;
        int value = numbers[index]; // This is where the ldelem instruction would be used
        Debug.Print(value.ToString()); // Output: 3
    }

This built fine. Then I added “UI\Keyboard\Keyboard.cs”, which caused a lot of errors when building because it was missing references, but there was no CLR_E_FAIL error. I went through the errors one by one, adding the required source files from the Glide project (copied from my other repository at commit a170cee0), references to Microsoft.SPOT.____ or System.____ DLLs, or resources. Eventually I got to a point where all of the missing references were satisfied and all I get is:

Description                                File             Line
CLR_E_FAIL                                 MMP
Cannot parse method signature 'Render'     Keyboard.cs      86

The Output window set to “Diagnostic” verbosity shows “000000BB ldelem – Not supported (TaskId:35)” again.

I’m very confused and frustrated.

It appears that there is a version discrepancy. Someone is generating Common Language Runtime (CLR) code at a later version than the currently supported version, which appears contradictory. This discrepancy could potentially explain the occurrence of an unsupported instruction error.

It is possible that installing multiple versions of Visual Studio on the same machine contributed to this type of issue.

Have you attempted to install the version of Visual Studio you intend to use on a clean or virtual machine (VM)?

BTW, the following is from the GHI .NETMF page:
“The lastest version of Visual Studio that works with NETMF is VS2013”.

Thanks for the suggestions! Yes, this latest attempt of incrementally reconstructing the project from scratch was done on a fresh install of Windows 10 with only VS2015 installed. One of my ideas is to try it in VS2013, but my old installer doesn’t work anymore because it tries to download from Microsoft and their server must no longer be there. I’m trying to find an ISO of VS2013 Community.

Is there any other information from the Output window when building that could help? It is almost 4000 lines long when set to “Diagnostic” level. Would anything point out this version mismatch?

I found an ISO of Visual Studio 2013 Community and got the project to build, so that was the difference. It was the exact same solution, just copied to a new install of Windows 10 with VS2013. Thanks for your replies.

1 Like

MMP0000 errors are usually because .NET 3.5 is not installed.

1 Like

I am impressed you remember that…

That had entered my mind but I sneezed and it was gone.

1 Like

Yes, I had installed .NET Framework 3.5 in “Programs and Features”. I also added the “MetaDataProcessor.exe.config” file in the “Tools” directory where the MetaDataProcessor executable is. Those are two ways to get around that error. This was something else.