Skip to main content

Youin .Net 3.5 and after you could use the activator class:

(T)Activator.CreateInstance(typeof(T), args) 

You could use the activator class:

(T)Activator.CreateInstance(typeof(T), args) 

in .Net 3.5 and after you could use the activator class:

(T)Activator.CreateInstance(typeof(T), args) 
added cast to T
Source Link
user287107
  • 9.4k
  • 1
  • 34
  • 47

You could use the activator class:

(T)Activator.CreateInstance(typeof(T), args) 

You could use the activator class:

Activator.CreateInstance(typeof(T), args) 

You could use the activator class:

(T)Activator.CreateInstance(typeof(T), args) 
deleted 1 characters in body
Source Link
user142162
user142162

youYou could use the activator class:

 Activator.CreateInstance(typeof(T), args) 

you could use the activator class:

 Activator.CreateInstance(typeof(T), args) 

You could use the activator class:

Activator.CreateInstance(typeof(T), args) 
Source Link
user287107
  • 9.4k
  • 1
  • 34
  • 47
Loading