I'm trying to port an existing C# class (a generic factory) that uses reflection, but I can't get this piece of code to compile:
Type[] types = Assembly.GetAssembly(typeof(TProduct)).GetTypes();
foreach (Type type in types)
{
if (!typeof(TProduct).IsAssignableFrom(type) || type == typeof(TProduct))
...
I tried looking at the Reflection in the .NET Framework for Windows Metro Style Apps and Assembly Class, where I found an example that didn't compile because of the "using System.Security.Permissions".