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

  • Home
  • SEARCH
  • 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 6636519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:11:46+00:00 2026-05-25T23:11:46+00:00

Before you say anything, I have read the previously asked questions about this issue.

  • 0

Before you say anything, I have read the previously asked questions about this issue. The answers there did not fix my problem.

It’s pretty simple, I guess, if you know the answer. Here’s my problem:

I’ve got a solution with several projects, I’m creating a plugin-based application where I use Reflection to load all assemblies. This part goes fine, I load all my assemblies like so

        var filePaths = Directory.GetFiles(@"C:\CustomerServiceModule\", "*.dll", SearchOption.AllDirectories).Where(n => n.Contains("bin"));
        foreach (var f in filePaths)
        {
            Assembly.LoadFile(f);
        }

Now I want to create an instance of a type, so I can work with it:

            var assembly = AppDomain.CurrentDomain.GetAssemblies().Where(a => a.ManifestModule.Name == "Kayako.dll").SingleOrDefault();
            var name = assembly.GetTypes();
            var type = assembly.GetType("Kayako.KayakoData");
            var lol = Activator.CreateInstance(type);

This goes badly because inside KayakoData I have this:

KayakoService _service = new KayakoService("xxx", "yyy", "zzz");

This service is an assembly that works, I’ve used it before. Version number is fine, there’s nothing in the GAC that overrides it, I can’t see any errors using Assembly Binding Log Viewer. I still get this error:

[System.LoadTypeException]{“Could not load type ‘KayakoRestAPI.KayakoService’ from assembly ‘KayakoRestAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’.”:”KayakoRestAPI.KayakoService”}

Anyone have any bright ideas? I’ve been staring myself blind at this. If I remove the service part from KayakoData the whole thing works, but I really need to run the service.

  • 1 1 Answer
  • 1 View
  • 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-25T23:11:47+00:00Added an answer on May 25, 2026 at 11:11 pm

    Quote from the documentation of the LoadFile method:

    Use the LoadFile method to load and examine assemblies that have the
    same identity, but are located in different paths. LoadFile does not
    load files into the LoadFrom context, and does not resolve
    dependencies using the load path, as the LoadFrom method does.
    LoadFile is useful in this limited scenario because LoadFrom cannot be
    used to load assemblies that have the same identities but different
    paths; it will load only the first such assembly.

    Conclusion: try LoadFrom in order to load dependent assemblies as well.

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

Sidebar

Related Questions

Read on before you say this is a duplicate, it's not. (as far as
Before someone said that I did not read I may say that I read
Hey guys, before you guys say anything I have searched and can not find
Before you answer this I have never developed anything popular enough to attain high
Before actually asking anything, I'll go ahead and say this is a theoretical question;
Now, before you say it: I did Google and my hbm.xml file is an
This is quite a controversial topic, and before you say no, is it really,
Ok, the question of the century :) Before you say or think anything, let
Before you -1 this for being such a simple question read further, because ive
I'm not sure if this is a known issue that I am running into,

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.