© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
14 replies
infernus8349

❔ System.Reflection

So I got a dll file that contains a class and its interface. What I want is to extract the class as an item than an instance.
So for example, if I have a dynamic variable of name "temp" and I wish to put the class which I extracted from dll by looping over GetExportedTypes() of the particular Assembly and putting value into "temp" when I get the preferred class, I want to be able to use it like

temp instance_of_clas = new temp();

like that, is that possible? if so, how to do it? if not, is there any alternative method (other than using Activator.CreateInstance()). My aim is not to get the instance, my aim is to get the class in such a way that I can create an instance using it.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

BindingFlags of System.Reflection
C#CC# / help
5mo ago
✅ .NET MAUI System.Reflection.TargetInvocationException
C#CC# / help
3y ago
❔ System.Reflection.ReflectionTypeLoadException: „Unable to load one or more of the requested types.
C#CC# / help
3y ago
reflection good course
C#CC# / help
2y ago