Friday, March 24, 2006 3:16 PM
Art Leonard
Office System 2007 PIA Compatibility
So, after talking with a couple customers at the ODC, I thought it best to make it clear what direction we're going in with Office's Primary Interop Assemblies.
To make it clear: Office System 2003 solutions will run on Office System 2007 without the need for a recompile, or any other change to your code.
Vetrans of the PIAs will note this is different from the past. Users of Office XP PIAs and Office 2003 PIAs had to deal with separate compilations and dependencies in on the PIAs to get their code to run right against the differing versions.
This is a big step for us, and it took a lot of effort and object model policing by Office to make this happen. Versioning assemblies that are dependent on type libraries is very, very tricky, and requies a whole new set of rules to get it right. There are some tools one can use as well to get it right, but I'll reserve that discussion for later.
How does it work?
Assemblies in the GAC allow for what's called a "publisher policy assembly". This assembly allows us to force assembly binding at runtime to access a different version of an assembly instead of the one requested. When you're Office 2003-built assembly requests the Office 2003 PIA from the GAC, the publisher policy will get the Office 2007 PIA instead.
The real trick in all this is that the Office 2007 assembly must be 100% compatible with the Office 2003 assembly. This takes time and tools to make sure that what we ship for Office 2007 will allow the Office 2003-built IL to find every function call that it expects from Office 2003. This requires the method signature (interfaceStrongname).(returnType)(memberName)(paramTypes) all be exactly identical. If they do not match, the CLR wil yield a JIT exception.
What it does not solve
Users of the new user interface in Office 12 know that there are a lot of wins and limitations when trying to access more obscure, deprecated features of Office 11 in Office 12. This will not solve those issues. You should read Jensen Harris' blog about programming against the new UI and make sure your old add-ins will continue to run properly.
Also, this will not retroactively go back and allow you to run on Office XP.
There are currently known issues in the Office 12 Beta1 Primary Interop Assemblies when running with solutions built on Office 2003. If you encounter any of these and are a beta partner, please make sure to log what you found at BetaPlace.
This posting is provided "AS IS" with no warranties, and confers no rights.