Top "Activator" questions

Activator is a .NET class that can create dynamically-typed object instances at runtime.

How to dynamically create generic C# object using reflection?

In C# I have the following object: public class Item { } public class Task<T> { } public class TaskA<…

c# generics reflection activator
C# Using Activator.CreateInstance

I asked a question yesterday regarding using either reflection or Strategy Pattern for dynamically calling methods. However, since then I …

c# reflection activator
Activator.CreateInstance can't find the constructor (MissingMethodException)

I have a class which has the following constructor public DelayCompositeDesigner(DelayComposite CompositeObject) { InitializeComponent(); compositeObject = CompositeObject; } along with a default …

c# .net activator missingmethodexception
How to use Activator to create an instance of a generic Type and casting it back to that type?

I have a generic type Store<T> and use Activator to make an instance of this type. Now …

c# generics reflection activator
How do i use Activator.CreateInstance with strings?

In my reflection code i hit a problem with my generic section of code. Specifically when i use a string. …

c# .net reflection activator
Fast creation of objects instead of Activator.CreateInstance(type)

I'm trying to improve the performance of our application. We have a lot of Activator.CreateInstance calls that are causing …

c# reflection reflection.emit activator createinstance
.NET: Unable to cast object to interface it implements

I have a class (TabControlH60) that both inherits from a base class (UserControl) and implements an interface (IFrameworkClient). I instantiate …

c# interface casting base-class activator
Can I use Activator.CreateInstance with an Interface?

I have an example: Assembly asm = Assembly.Load("ClassLibrary1"); Type ob = asm.GetType("ClassLibrary1.UserControl1"); UserControl uc = (UserControl)Activator.CreateInstance(…

c# .net reflection .net-assembly activator
How to check if a certain assembly exists?

I'm using the Activator to instantiate a new class based on the short name of an assembly (e.a. 'CustomModule'). …

c# reflection assemblies c#-2.0 activator
Activator.CreateInstance() troubles

I have a factory that is supposed to create objects that inherit from class Foo at run-time. I would think …

c# class instantiation activator