By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,330 Members | 1,274 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,330 IT Pros & Developers. It's quick & easy.

Dynamically accessing the most current version of an assembly

P: n/a
I'm accessing MSOutlook via Microsoft.Office.Interop.Outlook. It works
fine if I add a reference to either version 11 (Outlook 2003) or
version 12 (Outlook 2007) of the interop assembly to my project.
However, I don't want to build two different applications for each
version; I want my application to detect and use the current version
at runtime. But when I load the assembly at runtime, I don't have
access to its classes at compile time and I have to access everything
through reflection. Isn't there an easyer way?

Feb 1 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 1 Feb., 13:48, z...@gmx.net wrote:
I'm accessing MSOutlook via Microsoft.Office.Interop.Outlook. It works
fine if I add a reference to either version 11 (Outlook 2003) or
version 12 (Outlook 2007) of the interop assembly to my project.
However, I don't want to build two different applications for each
version; I want my application to detect and use the current version
at runtime. But when I load the assembly at runtime, I don't have
access to its classes at compile time and I have to access everything
through reflection. Isn't there an easyer way?
I just figured it out myself. In my project, I have to add a reference
to the older version, but it turns out that this will work out fine
when only the newer version is present at runtime.
I can work directly with everything from the old interface, and I can
load the new version (if present) dynamically, and access the classes
that aren't present in the old version using reflection. (Which isn't
half as bad as accessing everything through reflection).

Feb 1 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.