Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - programmatic assembly redirection (late binding?)

Reply
 
Old 2 Weeks Ago   #1 (permalink)
Ralf Steinstraesser


 
 

programmatic assembly redirection (late binding?)

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


My System SpecsSystem Spec
Old 2 Weeks Ago   #2 (permalink)
Wilson, Phil


 
 

Re: programmatic assembly redirection (late binding?)

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@newsgroup> wrote
in message news:ADF394F8-B0FC-4BAB-9589-C9F34CCDAE7B@newsgroup
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
>
My System SpecsSystem Spec
Old 2 Weeks Ago   #3 (permalink)
Family Tree Mike


 
 

Re: programmatic assembly redirection (late binding?)

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
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Option Strict Disallows Late Binding .NET General
Late Binding with IDispatch based com objects PowerShell
RC2 and late-binding / loose types PowerShell
Powershell interacting with COM automation with late-binding? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46