programmatic assembly redirection (late binding?)

  • Thread starter Ralf Steinstraesser
  • Start date
R

Ralf Steinstraesser

Hi,

I have to versions of an assembly as a reference, let's say version 1 and
version 2. Both of them write a certain file format v1 and v2, but none of
them is able to write both formats. A requirement for my application is to
have the user choose, which file format he wants to write. Therefor I want to
find a way to dynamically choose which version of the assembly to load. I am
familiar with assembly redirection through config files, but this is a static
method where you'd have to decide before starting the app, on which version
to load.

Any hints on this one?
 
W

Wilson, Phil

Why not Assembly.Load()???

This sounds like a plug-in type of app. Your file handling assemblies can
offer a standard interface and methods, a contract, and also some mechanism
to associate file format v1 with assembly 1. Then you'd map from v1 to the
assembly, load the assembly, reflect to find the interface and call the
appropriate methods. Assuming they're your assemblies of course.
 
F

Family Tree Mike

Ralf said:
Hi,

I have to versions of an assembly as a reference, let's say version 1 and
version 2. Both of them write a certain file format v1 and v2, but none of
them is able to write both formats. A requirement for my application is to
have the user choose, which file format he wants to write. Therefor I want to
find a way to dynamically choose which version of the assembly to load. I am
familiar with assembly redirection through config files, but this is a static
method where you'd have to decide before starting the app, on which version
to load.

Any hints on this one?

Do your users really know the version of the files created, to decide
which dll to use?

Could there possibly be a way to inspect the files to determine their
version?

As Phil said, Assembly.Load seems the way to go.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top