title: Create dynamic struct with Generic Type
body: <p>I'm new in .net and C# and I'm trying to create an instance of MyStruct, without known the Type before.
  so my class receive 3 type in the constructor and I need to create an Instance of MyStruct with this type.
  I looked on internet and saw the last part but I can't compile this.</p>
  
  <pre><code>namespace IQUnionTag
  {
      public class IQUnionTag
      {
          private struct MyStruct&lt;A, B, C&gt;
          {
              public A value1;
              public B value2;
              public C value3;
          }
          private object MyStructure;
          private Type a;
          private Type b;
          private Type c;
          public IQUnionTag(Type a, Type b, Type c)
          {
              this.a = a;
              this.b = b;
              this.c = c;
              int d = 2;
              var d1 = typeof (MyStruct&lt;&gt;); // Doesn't compile
              Type[] typeArgs = { a, b, c };
              var makeme = d1.MakeGenericType(typeArgs);
              object o = Activator.CreateInstance(makeme);
              Console.WriteLine(o);
          }
      }
  }
  </code></pre>
  
  <p>I just want something like</p>
  
  <pre><code>Mystructure = new MyStruct&lt;a,b,c&gt; // this doesn't compile too
  </code></pre>
  
  <p>typeof(MyStruct&lt;>) make error compile like</p>
  
  <pre><code>Erreur Using the generic type 'IQUnionTag.IQUnionTag.MyStruct&lt;A,B,C&gt;' requires 3 type arguments
  </code></pre>
  
  <p>i certainly missed something, can you help me to create my instance?</p>