Note: When I originally wrote this article I was frustrated by the confusion surrounding updates for Microsoft Interop Assemblies. Each time I updated a Visual Studio project to a new framework I had to go back and figure out how to update the Primary Interop Assemblies (PIA). Now, with Visual Studio 2010, it has become much easier to add Microsoft Office applications to your projects.
Once again I had problems updating an older project to Visual Studio 2010. And it was a familiar culprit: Microsoft Interop Assemblies. I can't count the number of times this has happened over the years.
Received the following error when building the project: Cannot find wrapper assembly for type library "Microsoft.Office.Core"
Solution (for updating an old project):
- Change Application Target Framework from .NET Framework 2 to .NET Framework 4.
- Download Microsoft Office 2010: Primary Interop Assemblies . The PIA covers Access, Excel, InfoPath, Outlook, PowerPoint, Project, Publisher, SharePoint Designer, Visio, and Word (all 2010 versions).
- Remove Microsoft.Office.Core reference (old PIA reference)
- Add new PIA reference to Office (Office.dll), got conflict, so removed the reference. (I believe this must have added the Microsoft.Office.Interop.Excel dll, but never looked into).
- Microsoft.Office.Interop.Excel now updated to Microsoft Excel 14.0 Object Library.
- Project now builds and the Excel spreadsheet built by the program works.
Basic idea: Download the latest Office Primary Interop Assembly (PIA), remove any references to the older Office PIA, and then add references to the new PIA. Make sure you are checking the versions as you add the new references (the old PIA dll’s will still be in the reference list).
Explanation on Microsoft Primary Interop Assemblies (PIA)
These assemblies are used to programmatically interact with an Office application from a .NET program. For example, a .NET program can use the PIA to create a spreadsheet, perform operations on it, and save it (all from within the program). The downside is that these assemblies interact with the Office applications via COM interface so they are very slow in general.

By John Dorsey IT Brigade Inc.

ASP.NET
Microsoft, C#, Office.Interop, Excel