Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 74493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:22:01+00:00 2026-05-10T20:22:01+00:00

Scenario I have two wrappers around Microsoft Office, one for 2003 and one for

  • 0

Scenario

I have two wrappers around Microsoft Office, one for 2003 and one for 2007. Since having two versions of Microsoft Office running side by side is ‘not officially possible’ nor recommended by Microsoft, we have two boxes, one with Office 2003 and the other with Office 2007. We compile the wrappers separately. The DLLs are included in our solution, each box has the same checkout but with either Office 2003 or 2007 ‘unloaded’ so it doesn’t attempt to compile that particular DLL. Failure to do that will throw errors on compilation due to the Office COM DLLs not available.

We use .NET 2.0 and Visual Studio 2008.

Facts

Since Microsoft mysteriously changed the Office 2003 API in 2007, renaming and changing some methods (sigh) thus making them not backwards compatible, we need the two wrappers. We have each build machine with the solution and one Office DLL activated. E.g.: the machine with Office 2003 has the ‘Office 2007’ DLL unloaded, therefore not compiling it. The other box is the same idea but the other way around. All this because we can’t have 2 different Office in the same box for programming purposes. (you could technically have two Office together according to Microsoft) but not for programming and not without some issues.

Problem

When we change the Application Version (from 1.5.0.1 to 1.5.0.2 for example) we need to recompile the DLL to match the new version of the application, this is automatically done, because the Office wrapper is included in the solution. Since the wrappers are contained in the solution, those inherit the APP Version, but we have to do it twice and then ‘copy’ the other DLL to the machine that creates the installer. (A Pain…)

Question

Is it possible to compile a DLL that will work with any version of the application, despite being ‘older’? I’ve read something about manifests but I have never had to interact with those. Any pointers will be appreciated.

The secret reason for this is that we haven’t changed our wrappers in ‘ages’ and neither did Microsoft with their ancient APIs, yet we are recompiling the DLL to match the app version on every release we make. I’d like to automate this process instead of having to rely on two machines.

I can’t remove the DLL from the project (neither of them) because there are dependencies.

I could create a third ‘master wrapper’ but haven’t thought about it yet.

Any ideas? Anyone else with the same requirement?

UPDATE

Clarifying:

I have 1 solution with N projects.

‘Application’ + Office11Wrapper.dll + Office12Wrapper.dll.

Both ‘wrappers’ use dependencies for application + other libraries in the solution (datalayer, businesslayer, framework, etc.)

Each wrapper has references for the respective Office package (2003 and 2007).

If I compile and don’t have office 12 installed, I get errors from Office12Wrapper.dll not finding the Office 2007 libraries. So what I have are two building machines, one with Office 2003, one with Office 2007. After a full SVN update + compile on each machine, we simply use office12.dll in the ‘installer’ to have the wrapper compiled against the ‘same code, same version’.

Note: The Office 2007 Build Machine, has the Wrapper for Office 2003 ‘unloaded’ and viceversa.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:22:01+00:00Added an answer on May 10, 2026 at 8:22 pm

    When the .NET assembly resolver is unable to find a referenced assembly at runtime (in this case, it cannot find the particular wrapper DLL version the application was linked against), its default behavior is to fail and essentially crash the application. However, this behavior can be overridden by hooking the AppDomain.AssemblyResolve event. This event is fired whenever a referenced assembly cannot be found, and it gives you the opportunity to substitute another assembly in place of the missing one (provided that they are compatible). So, for instance, you could substitute an older version of the wrapper DLL that you load yourself.

    The best way I’ve found to do this is to add a static constructor on the main class of the application that hooks the event, e.g.:

    using System.Reflection;  static Program() {     AppDomain.CurrentDomain.AssemblyResolve += delegate(object sender, ResolveEventArgs e)     {         AssemblyName requestedName = new AssemblyName(e.Name);          if (requestedName.Name == 'Office11Wrapper')         {             // Put code here to load whatever version of the assembly you actually have              return Assembly.LoadFile('Office11Wrapper.DLL');         }         else         {             return null;         }     } } 

    By putting this in a static constructor of the main application class, it is guaranteed to run before any code attempts to access anything in the wrapper DLL, ensuring that the hook is in place ahead of time.

    You can also use policy files to do version redirection, but that tends to be more complex.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The scenario is I have two div s: one is where I select items
I have a scenario where I have two files, one is index.php and the
here's my scenario: I have three projects: two DLLs and one console application, let's
So, Here is my scenario: I have two activity and one service --> all
Here is the scenario: You have two images and they are stacked on one
Ok, i have simple scenario: have two pages: login and welcome pages. im using
Scenario I have two WCF Services combined in a single App.Config file. I can't
Here is the scenario: I have two asp pages. a.aspx is layout and b.aspx
I have scenario, I have two update panels on the page (both have update
Scenario I have an TWO datbase tables of exactly the SAME STRUCTURE. The difference

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.