1

First I have to reference Jon Skeet's answer to a similar question

https://stackoverflow.com/a/266282/1184296

In his answer he wrote this

Type genericClass = typeof(Generic<>);

What I don't understand here is how to get Generic<> to show up.

I tried adding usings with all the namespaces under System but no luck. Nothing shows up in IntelliSense and Generic<> stays underlined in red stating "The type or namespace 'Generic' could not be found...".

Does anyone knows how to solve this?

Thanks.

Community
  • 1
  • 1
dizarter
  • 448
  • 1
  • 8
  • 21
  • 6
    You're missing the fact that he defined the `Generic` class himself in that same piece of code – ThaMe90 Sep 18 '13 at 12:22

1 Answers1

1

If you look at the code in the Post, John Skeet has created a custom class..

public class Generic<T>
{
    public Generic()
    {
        Console.WriteLine("T={0}", typeof(T));
    }
}

So, you could do the same, you might need John Skeets permission to take that code though? :)

Christian Phillips
  • 18,399
  • 8
  • 53
  • 82