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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:50:59+00:00 2026-05-15T20:50:59+00:00

I am currently working on a data harvester for a project. The way it

  • 0

I am currently working on a data harvester for a project. The way it works is it basically calls another program which collects the data, and that program returns a data structure containing a collection of queue information. The harvester then serializes out the data. The program that actually collects the data is maintained by another team, and recently they did an upgrade and decided to restructure their code. The method I am calling is still in the same location, however, the data structure I get back got moved to a different assembly (it’s code remained the same). The fun part of this is that we have both versions of this product in the field right now, so depending on which version a client has, the data structure I need may be in one of two different assemblies. My boss wants to try to only have one version of the harvester program if possible.

So, my question is this: using C# and .NET 3.5, is there a way to pick which assembly to use at runtime? I think I could use reflections, but I’d like to know if there’s any way I could write the code normally for compile time and then resolve the dependency at run time depending on the other program’s version.

  • 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-15T20:51:00+00:00Added an answer on May 15, 2026 at 8:51 pm

    You could try using the Adapter (wrapper) design pattern.

    interface IQueueInfoProvider
    {
       DataStructure FetchData();
    }
    
    class Version1QueueInfoProvider : IQueInfoProvider
    {
       DataStructure FetchData()
       {
          //Fetch using Version1 Assemblies.
       }
    }
    
    class Version2QueueInfoProvider : IQueInfoProvider
    {
       DataStructure FetchData()
       {
           //Fetch using Version2 Assemblies.
       }
    }
    

    I believe .NET won’t attempt to load referenced assemblies if they aren’t needed, but if i’m wrong, you can always use reflections.

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

Sidebar

Related Questions

I am currently working on program that must read data from a XML stream
I'm currently working on creating a new C# project that needs to interact with
I'm currently working on a data model design (which will be backed by an
I am currently working on rewriting an application to use Data Mappers that completely
In the program I'm currently working on, my table has a Create_Timestamp column, which
I'm currently working on a data migration project and for performance-related issues, I want
I'm currently working on a reasonably complicated data input form, based around ASP.NET Web
I'm currently working in a piece of code where both logic and data access
I'm currently working on a Silverlight app and need to convert XML data into
I am currently working on a project and my goal is to locate text

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.