0

Hi all, I was wondering, is there also a classloader in C#? I know that Java has it; if there isn't a classloader in C#, how would one load classes during runtime? If there is a classloader, how do I use it? I mean can someone show me an example please :D

2
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by PoovenM
0

I'm still a bit lost. I've read that Reflections allow users to read and modify application assemblies and its metadata but I'm still uncertain as to how I would load a class dynamically...
On the site CodeSource.net they give code for loading a binary file, but I want to be able to load a class during runtime. Suppose that the class name is specified in a file, for example an xml file:

<driver>
<id>RX201</id>
<class>WaveTrendSensor</class> 
</driver>

So I'd want to create a WaveTrendSensor object but how do I load the appropriate class?

1

I don't know really if you can create object from class @ runtime and this class in text or xml file but you can work around this problem by creating assembly @ runtime and call this assembly by reflection. This solution if and only if Reflection don't create object from class @ runtime

Votes + Comments
Thanks for the help man! :)
0

Oh gosh, it's moments like this that I wish I could just use Java. Thanks for the help Ramy!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.