G
Guest
Hi all,
I m new to this class..
With System.Reflection... u can create run time objects for a specified
class in a assembly...
Now if once the Assembly is loaded in the memory then does that means that
it loads the Assembly again when we call the same function..
Here is the code to make some more sense to my question
Public Function MyFunction()
Dim MyAssembly As System.Reflection.Assembly
Dim Str As String
Str = "C:\TEMP\TempProject\WindowsApplication3\ClassLibrary1\bin\" &
"ClassLibrary1.dll"
MyAssembly = MyAssembly.LoadFrom(Str)
Dim MyType As Type = MyAssembly.GetType("ClassLibrary1.Class2")
Dim Test As Object
Test = Activator.CreateInstance(MyType)
Test.CallMyFunction("Testing")
End Function
Now if i call this function in a loop then does it means that the Assembly
is loaded again. OR once the assembly is loaded it wont be loaded again in
the memory???
And are the assembly shared at all??? and what bout if its in the Web
enviornment would it be in the IIS memory???
Plz reply
cheers
chintan
I m new to this class..
With System.Reflection... u can create run time objects for a specified
class in a assembly...
Now if once the Assembly is loaded in the memory then does that means that
it loads the Assembly again when we call the same function..
Here is the code to make some more sense to my question
Public Function MyFunction()
Dim MyAssembly As System.Reflection.Assembly
Dim Str As String
Str = "C:\TEMP\TempProject\WindowsApplication3\ClassLibrary1\bin\" &
"ClassLibrary1.dll"
MyAssembly = MyAssembly.LoadFrom(Str)
Dim MyType As Type = MyAssembly.GetType("ClassLibrary1.Class2")
Dim Test As Object
Test = Activator.CreateInstance(MyType)
Test.CallMyFunction("Testing")
End Function
Now if i call this function in a loop then does it means that the Assembly
is loaded again. OR once the assembly is loaded it wont be loaded again in
the memory???
And are the assembly shared at all??? and what bout if its in the Web
enviornment would it be in the IIS memory???
Plz reply
cheers
chintan