c#.net 4.0 - no pia - is this all I need?

1.2k views Asked by At

Reference the Microsoft.Office.Interop.Excel and set Embed Interop Type to true?

Will doing so ensure my app is backward compatible? (As long as I use safe methods that work on all versions.)

Or do I have to use something like late binding and all in order for it to be compatible against multiple versions?

1

There are 1 answers

0
Malaise On

This link indicates that you get some amount of version independence:

1.Additional enhancements are possible when you call a COM type that does not require a primary interop assembly (PIA) at run time. Removing the dependency on PIAs results in version independence and easier deployment. For more information about the advantages of programming without PIAs, see Walkthrough: Embedding Types from Managed Assemblies (C# and Visual Basic).

I can't give you a definitive answer though as my brief experience with Office Interop was limited to 2007. It all depends on if Microsoft is changing the interface ID's for the Office interop for each version of Office.

But as long as you keep to methods you know existed in previous versions I think you'll be fine.