Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6652861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:11:40+00:00 2026-05-26T01:11:40+00:00

I’m building a website in ASP.NET that allows creating new modules based on a

  • 0

I’m building a website in ASP.NET that allows creating new modules based on a common class. The new modules need to have the ability to extend the base class with their own library of methods/functions. I would like to load all modules at Application_Start. They are identified by a unique string key.

The structure is something like this:

root

-Bin
--module1.dll    
--module2.dll

-Modules
--module1
---mod.key1
--module2
---mod.key2

At startup each module folder is read and it’s key identified, all settings loaded from db and common properties set, then stored in a collection. When a page is requested for a module, the base page class loads the appropriate module using it’s unique directory key. Problem is the base module class does not contain the library of methods specific to that module (Only it’s properties/settings loaded from db). How can I extend the module class to include methods during the module load at startup, or just instantiate the correct extended class dynamically using it’s string name? or any other ideas? I don’t want to hard code class names in the app load method so it can scale for future modules to be added.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:11:41+00:00Added an answer on May 26, 2026 at 1:11 am

    There are several ways to do that. One way is to create a base class or interface from which to inherit, write your descendant classes in another DLL, and then use the Assembly.LoadFrom() method to load the appropriate classes from the DLL, as needed.

    public MyType LoadTypeFromAssembly(string assemblyPath, string typeName)
    {
                var assembly = Assembly.LoadFrom(assemblyPath);
    
                if (assembly == null)
                    throw new InvalidOperationException("Could not load the specified assembly '" + assemblyPath + "'");
    
                var type = assembly.GetType(typeName);
                if (type == null)
                    throw new InvalidOperationException("The specified class '" + typeName + "' was not found in assembly '" + assemblyPath  + "'");
    
                var instance = (MyType)Activator.CreateInstance(type);
                return instance;
    }
    

    Where MyType is the type of your base class or interface, and typeName is the name of your descendant class (that inherits from MyType).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.