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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:09:19+00:00 2026-05-20T05:09:19+00:00

We have a rules processing system where each rule is represented by a class

  • 0

We have a rules processing system where each rule is represented by a class and all rules implement a common interface. Occasionally, we will add a rule (class) to the assembly but when that rule comes up for processing, the system cannot find that class. The code we use to run the rules looks like this.

private void runClass(string dllName, string className, string methodName, string ruleNamespace)
{
    Assembly _Assemblies = Assembly.LoadFrom(dllName);

    Type _Type = null;
    string nameSpace = _Assemblies.ManifestModule.Name.Substring(0, _Assemblies.ManifestModule.Name.ToLower().IndexOf(".dll"));
    if (ruleNamespace.Trim() != "")
        nameSpace = nameSpace + "." + ruleNamespace;
    _Type = _Assemblies.GetType(nameSpace + "." + className);
    if (_Type == null)
        throw new Exception("Cannot find class " + className + " in " +     nameSpace + ".");

    IRule rule = (IRule)Activator.CreateInstance(_Type);
    rule.Process();
}

I have tried cleaning the build, rebuilding from scratch, rebooting, wiping the DLL’s by hand and rebuilding and several other things that I can’t remember right now. The freaky part is that there may be 50 rules in an assembly and 48 of them are found but two are not, and the two that are not found are the ones that have been just added. Can anyone think of what might cause this?

Update: I found the actual answer and accepted the one closest to the actual answer because it led me in the right direction. We have two branches of code, one for dev and one for QA on our dev machines. the applciation is a web service and in order to debug it, we have to start the unit tests, attach to the aspnet_wp.exe process and then set breakpoints. The reason why it couldn’t find the classes was because the machine got pointed to the QA instance of the web service, so, any new classes would not be found; all the old ones were there because they had been deployed to the QA branch. Thanks for all the comments and eventually leading me to the right places to look, it was eventually all about the deployed location but not in the way you would think. 🙂

  • 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-20T05:09:19+00:00Added an answer on May 20, 2026 at 5:09 am

    If this problem persists after a reboot then you have 1 of 3 potential issues.

    1. You aren’t actually deploying it.

    2. Your app uses some type of custom assembly caching mechanism and doesn’t refresh based off of seeing a new assembly in a pick up folder.

    3. You are deploying it, but not to the correct location/server.


    If I was to place a bet, I’d see what was behind door #3.


    UPDATE
    Based on the comments: I didn’t realize you were running this locally versus deploying to the server.

    That said, it sounds like you are referencing the assembly by the assembly name instead of through a project level reference. VS caches assemblies during development and probably isn’t refreshing your local cache.

    Further, depending on the project type it sometimes gets confused as to where the assembly actually is. For example, in web site projects VS will happily (and usually incorrectly ) retarget your assembly references if it finds a copy of the assembly in the GAC or along some other path. Web Application projects don’t usually exhibit this behavior.

    In the main project, right click on the assembly reference and see where it thinks it’s loading the dll from.

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

Sidebar

Related Questions

Rules like A parent object will have up to 2 children could be enforced
What exactly are the Python scoping rules? If I have some code: code1 class
I have seen various rules for naming stored procedures. Some people prefix the sproc
Do you have any advice/rules on selecting a multiplier to use in a (multiplicative)
On my site I have mod_rewrite rules to make the URLs more search engine
I have a few problems with my mod_rewrite rules. There a three different url
I have a strange problem with mod_rewrite, the rules that are relevant here are:
Some background: In Germany (at least) invoice numbers have to follow certain rules: The
Do you know any documentation about the rules of using update sites? I have
I just finished reading this post: https://developer.yahoo.com/performance/rules.html#flush and have already implemented a flush after

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.