Dictionary with Generic Key

I tried to create a Dictionary using a generic Tuple (struct) as key.

This works fine:
private static Dictionary<Tuple<DefenseType, DamageType>, float> defenseStandardTable = null;

But if I write this:

private static Dictionary<Tuple<DefenseType, DamageType>, float> defenseStandardTable = new Dictionary<Tuple<DefenseType, DamageType>, float>();

I get the following compilation error in Unity (VS compiles both without any issues.):

Assertion at …\mono\metadata\class.c:1727, condition `class->image->dynamic || field->offset > 0’ not met

Does anyone have any idea how to fix that? Is there a special step that has to be observed? Or is a dictionary with such a key just not possible in unity?

(I guess I can just make strong typed tuples but that isn’t very elegant.)

I haven’t had good luck with Tuples in Unity. If you use Visual Studio to edit your code and compile an assembly over to your assets folder rather than keep all your “scripts” in Unity (which is what you should do), you get a much cleaner error: that type isn’t supported and you need a reference to another assembly. I never trusted that reference, so I just write one own Tuple - that’s a price you pay once per number of variants you want to support and it pays dividends forever.