Spontaneous Publicity
blogs are the new phone book

Using Reflection in Asp.Net 2.0 Web Applications

February 27, 2006 04:18 by Luke
I have been searching far and wide for this solution for a long time and I just sort of happened upon it...so I thought I would share it here. One of the big changes from Asp.Net 1.1 to 2.0 was the format of their web projects. I actually really like the new format alot. There was, however, one problem that I could not get past. I have written various "plug-in" type frameworks where you specify classes in an xml file which are loaded at runtime. The xml usually looks something like this: Item assembly="myAssembly" class="myClass" /> so at runtime I just have to load the given assembly and then I can create an instance of the given class. The problem with the new web project format is that you don't really have control over your web project assembly name like you used to in Asp .net 1.1. So, here ist he trick I learned: Assembly assembly = Assembly.Load("App_Code");

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: .Net | C# | Development
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

November 21. 2008 22:26