Main Page | Report this Page
.NET DotNet Forum Index  »  General Discussion  »  programmatic assembly redirection (late binding?)...
Page 1 of 1    

programmatic assembly redirection (late binding?)...

Author Message
Ralf Steinstraesser...
Posted: Thu Nov 05, 2009 3:46 am
Guest
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?

--
Dipl.-Ing. Ralf Steinstraesser
Software Architekt
Bissantz & Company GmbH
 
Wilson, Phil...
Posted: Thu Nov 05, 2009 2:21 pm
Guest
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.
--
Phil Wilson
The Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972


"Ralf Steinstraesser" <RalfSteinstraesser at (no spam) discussions.microsoft.com> wrote
in message news:ADF394F8-B0FC-4BAB-9589-C9F34CCDAE7B at (no spam) microsoft.com...
Quote:
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?

--
Dipl.-Ing. Ralf Steinstraesser
Software Architekt
Bissantz & Company GmbH
 
Family Tree Mike...
Posted: Thu Nov 05, 2009 5:46 pm
Guest
Ralf Steinstraesser wrote:
Quote:
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.

--
Mike
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Thu Dec 10, 2009 5:54 am