简体   繁体   中英

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

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM