I am trying to get rid of some references by using string representation of certain types. But compiler is not letting me do it the way I want in case of generic methods. I
foreach (var component in container.Components.OfType()) {
...
}
Problem is you have to use the actual type expression in generics, not a string. You could construct the type using reflection if you really need to use the string.