You get that error because x
is not a type. You need to specify a type as a type parameter.
In fact, you can use dynamic
as a type parameter if you use it correctly:
var dict = new Dictionary();
dict.Add("Item1", 123);
dict.Add("Item2", "Blah");
This compiles and runs just fine.