Dynamically Load a Class ASP.NET 2.0
For this question, I have a project with a Class called Class1.
All I want to do is create the Class1 using
MyAssembly.GetType("Class1")
but it does not find the Class1. In a Windows app you can call it doing this
MyAssembly.GetType("WindowsApplication1.Class1").
How can I do it in ASP.NET 2.0.
Thanks,
Code:
Dim ep As String = Assembly.GetExecutingAssembly.ManifestModule.FullyQualifiedName ' Assembly.GetExecutingAssembly.Location
Dim MyAssembly As Assembly = Assembly.LoadFrom(ep)
'--Pass the name of the class you want to create.
Dim mType As Type = MyAssembly.GetType("Class1")
Re: Dynamically Load a Class ASP.NET 2.0
Have you tried
MyAssembly.GetType("WebApplication1.Class1") ?