473,769 Members | 6,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically accessing the most current version of an assembly

I'm accessing MSOutlook via Microsoft.Offic e.Interop.Outlo ok. 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
1 2135
On 1 Feb., 13:48, z...@gmx.net wrote:
I'm accessing MSOutlook via Microsoft.Offic e.Interop.Outlo ok. 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3171
by: Ahmet | last post by:
Hi; How can I get control list (Controls) of a form in a dll dynamically activated using Activators.CreateInstance. I need all controls names and attributes of one form which is in one dll. Is it possible to do this ? thanks in advance.
1
21146
by: Jon Davis | last post by:
I'm trying to access my application files for a plug-in I'm building for a third party application. I have an assembly with several dependency assemblies. The dependency assemblies are in the same directory as the assembly. d:\dev\cs\MyApp\bin\Release\MyApp.dll d:\dev\cs\MyApp\bin\Release\Dependency1.dll d:\dev\cs\MyApp\bin\Release\Dependency2.dll
1
5022
by: Benjamin | last post by:
Hi, I'm currently writing a Web Services that interacts with a database. To allow me to use not just one database provider (for example, I could use MS Access, SQL Server or MySQL), the Web Service dynamically loads up an assembly that implements an Interface I called IDatabase. To load the assembly and create an object, I wrote this function: private IDatabase LoadDatabasePlugin( string assemblyFile, string
4
1678
by: Shiju Poyilil | last post by:
Hello EveryBody, I have a dropdownlist with some values as .net server controls & a button , on clicking a button i need to generate the choosen contorl dynamically. I am giving a small glimpse of my code for your understanding the aspx page has dropdwon list with values as below. <asp:DropDownList id="DropDownList1" runat="server"> <asp:ListItem Value="Label">Label</asp:ListItem> <asp:ListItem...
5
2584
by: volvox | last post by:
hi, is it possible to access protected mode registers (EAX , EBX,ECX...) via assembly in C .
2
3119
by: Smithers | last post by:
Using 3.5, I am stuck in attempting to: 1. Dynamically load an assembly 2. Instantiate a class from that assembly (the client code is in a different namespace than the namespace of the dynamically loaded assembly) so far so good (per my code below)... but here is where I'm getting hung up: 3. Call methods of that type (see comments in my code) If the types in the dynamically loaded assembly were in the same namespace
1
1378
by: Jordan S. | last post by:
I plan to load an assembly during application startup, and load that assembly via reflection (i.e., it isn't referenced in the application's assembly manifest). The assembly will be loaded into the application's default app domain, with code like this: using System.Reflection; Assembly loadedAssembly = Assembly.LoadFile(pathToMyAssembly); My question: When I need to access members of the assembly , how does the application know to get...
9
6351
by: =?Utf-8?B?VGhvbWFzIFcuIEJyb3du?= | last post by:
"parez" wrote: Assembly.LoadWithPartialName does indeed work!! Now, why is this incredibly useful routine deprecated and we are instructed to use Assembly.Load instead which does not provide the same functionality?!? I'll check now, but maybe someone knows... Is this deprecated routine still available in Visual Studio 2008 and .NET 3.5?
7
6670
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a tabcontainer which has 1 panel already, however I want to try create the TabPanels dynamically. I followed the advice here: http://www.asp.net/learn/ajax-videos/video-156.aspx (3rd comment - Joe Stagner)
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5309
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.