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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:42:01+00:00 2026-05-25T14:42:01+00:00

My code is type = Type.GetType(key); Key which i pass is a namespace qualified

  • 0

My code is

type = Type.GetType(key);

Key which i pass is a namespace qualified name .

My code is in BusinessLayer. I am creating a instance of DataAccessLayer.
DataAccessLayer reference is added to BusinessLayer.

I am getting the error as “Could not load type ‘Catalyst.DAL.ExamDAO.CExamDAO’ from assembly ‘BusinessLayer, Version=1.9.3.0, Culture=neutral, PublicKeyToken=null’.”.

What should i do to specify explicitly thats the class is from DataAccessLayer ?

Key vale is “Catalyst.DAL.ExamDAO.CExamDAO”

Edit :

My actual code is

public static object getClassInstance(string key, params  object[] constructorArgs)
        {
            string assemblyPath = null;
            string customClassName = null;
            DataSet objDataset = getAssemblyInfo(key);
            if (objDataset != null && objDataset.Tables.Count > 0 && objDataset.Tables[0].Rows.Count > 0)
            {
                assemblyPath = objDataset.Tables[0].Rows[0]["ACA_ASSEMBLY_PATH"].ToString();
                customClassName = objDataset.Tables[0].Rows[0]["ACA_CLASS_NAME"].ToString();
            }

            Assembly assembly;
            Type type;

            if (assemblyPath != null && assemblyPath != string.Empty)
            {
                assembly = Assembly.LoadFile(assemblyPath);
                type = assembly.GetType(customClassName);
            }
            else // if no customisation
            {
                type = Type.GetType(key);
            }

            object classInstance = constructorArgs == null ? Activator.CreateInstance(type) : Activator.CreateInstance(type, constructorArgs);
            if (classInstance == null) throw new Exception("broke");
            return classInstance;

        }

I am trying to load the default classes if there is no customization . Method is in BO .
If i pass the key as namespace qualified names of any Bo type it converts . But DAO type it wont

  • 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-25T14:42:01+00:00Added an answer on May 25, 2026 at 2:42 pm

    If you know that whatever type it is will be within DataAccessLayer, then I’d get an Assembly reference as simply as possible, e.g.

     Assembly assembly = typeof(AnyPublicTypeWithinTargetAssembly).Assembly;
     Type type = assembly.GetType(namespaceQualifiedTypeName);
    

    An alternative is to use Type.GetType with an assembly-qualified name, but that’s more long-winded in terms of specifying the type name.

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

Sidebar

Related Questions

I just tested which type of code is executed by the WinForms Designer in
The code below gives an error: Property 'Int32 Key' is not defined for type
here's the code, Type tbn = Type.GetType(dii.DictionaryName); DictionaryXmlInfo4BaseDictionary<tbn>.AddDictionaryXmlInfo((message));//error
This is my code: type HoraAtendimento = (String, Int, Int) htmlHAtendimento :: [HoraAtendimento] ->
What is the difference between these two pieces of code type IInterface1 = interface
When running the below code a type is never returned, despite there being a
I have come across the following type of code many a times, and I
I am looking for an app that will let me type in code ON
I get the following compilation error with the following source code: Compilation Error: Type
I always see the code like this in the blogs: $.ajax({ type: POST, contentType:

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.