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 9293991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:16:04+00:00 2026-06-18T21:16:04+00:00

I see this question a fair amount on SO, and I’ve followed that advice,

  • 0

I see this question a fair amount on SO, and I’ve followed that advice, but I appear to be doing something wrong. The dll seems to load in fine but the object CreateInstance is returning is null.

I have this dll:

namespace Backfill
{
public class Module : Kernel.Module
{
    public override void ModuleStart()
    {
        //Stuff
    }
}
}

In another DLL with a DIFFERENT namespace

namespace Kernel
{

public abstract class Module
{
    public abstract void ModuleStart();
}



public static void KernelStart()
    {
        string load_dll = @"Path to DLL";

        Assembly test_dll = Assembly.LoadFile(load_dll + ".dll");

        Module test_mod = (Module)test_dll.CreateInstance("Kernel.Module");

        test_mod.ModuleStart();
    }
}

(Module)test_dll.CreateInstance("Kernel.Module"); is returning null, though. Any idea why?

  • 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-06-18T21:16:05+00:00Added an answer on June 18, 2026 at 9:16 pm
    (Module)test_dll.CreateInstance("Kernel.Module")
    

    This won’t work. As you specified, the Module class which you’re trying to instantiate (which, I assume, is the one from the first DLL), is not in the Kernel namespace, but in the Backfill namespace. You should therefore have something along these lines:

    (Module)test_dll.CreateInstance("Backfill.Module")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I see this question here on SO but I am not sure that answers
This question is famous but everyone always says go to see this Notepad Tutorial
So I see that this question has already been asked, however the answers were
In this question I see that microsoft ships the XML documentation files for the
I'm writing a custom widget for kivy(see this question), but I just found out
(See this question in ServerFault ) I have a Java client that uses Socket
I did see this question but not much on .NET... I want to write
i see this question has been posted many times but it has been solved
See this question . Except that the answer returns the child element when a
I see this question but it's from 2008. Seems like many version control systems

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.