how do I retrieve by reflection all the types in web application?

G

Guest

I would like your help to find out how do I retrieve by reflection all the
types in web application?

In VS 2003 I used to do:

public class Global : System.Web.HttpApplication
{
protected void Application_Start(Object sender, EventArgs e)
{
Type myType = typeof(Global);
Module module = myType.Module;
Type[] types = module.GetTypes();
}
}

The thing is that it was changed in VS 2005.
There are several assemblies depend on project configuration (for each web
page, master page, different language etc…)
Now when I do so I get only types under App_Code, I don’t get the reset
types because they sit in different assemblies.
I also couldn’t find the way to find which assemblies are used on the web
application.

10x for your help.
 
M

Mikeon

Hello!

I hate replies that say: "I haven't checked it but it should work" but
here it is:

Try this:

AppDomain.CurrentDomain.GetAssemblies()

and then navigate the result.
 
G

Guest

Mikeon hi,

It does work,
The problem is that on application start the app domain doesn't have the
assemblies of pages and controls only classes in the app code.

After the first page was loaded it has everything.

Is there a way to find it out before the first page is loaded.

10x
TD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top