<p>I have an abstract generic class <code>BLL&lt;T&gt; where T : BusinessObject</code>. I need to open an assembly that contains a set of concrete BLL classes, and return the tuples (businessObjectType, concreteBLLType) inside a Dictionary. There is the part of the method I could do until now, but I'm having problems to discover T.</p>

<pre><code>protected override Dictionary&lt;Type, Type&gt; DefineBLLs()
{
   string bllsAssembly = ConfigurationManager.AppSettings["BLLsAssembly"];

   Type[] types = LoadAssembly(bllsAssembly);

   Dictionary&lt;Type, Type&gt; bllsTypes = new Dictionary&lt;Type, Type&gt;();

   foreach (Type type in types)
   {
     if (type.IsSubclassOf(typeof(BLL&lt;&gt;)))
        /* how to know T in the situation below? */
        bllsTypes.Add(??businessObjectType (T)??, type);
   }

   return bllsTypes;
}
</code></pre>

So the concrete classes will be closed rather than generic? Here's a short program which demonstrates what I
think
you're after...
```
```
using System;
using System.Reflection;

public abstract class Base<T>
{
}

public class Concrete : Base<string>
{
}

class Test
{
    static void Main()
    {
        Type type = typeof(Concrete);
        Type baseType = type.BaseType;
        Type typeOfT = baseType.GetGenericArguments()[0]; // Only one arg
        Console.WriteLine(typeOfT.Name); // Prints String
    }
}
```
```
Note that here I'm
assuming
that we only need to go up one level to get to the appropriate base type, and that the concrete class
will
be closed. You'd want to put more checks into your real code, of course, but I suspect it was the call to
GetGenericArguments
that you were missing.