Common Pitfalls during PIA Deployment and Installation (Mary Lee)

  • Comments 42

Deploying or installing the Office primary interop assemblies (PIAs) can sometimes be problematic. There are several common errors that occur when you try to deploy or install the PIAs.

Deployment pitfalls

A. Can I deploy the PIA DLL with my setup project?  Yes, you can include the PIA DLL in your setup project, but we recommend that you use the Primary Interop Assemblies for the 2007 Microsoft Office system redistributable file from the Microsoft Download Center.  this way, the installer copies the PIAs into the GAC, and also installs binding redirects.  The binding redirects ensure that the latest version of the PIAs on the computer are always loaded.  This is how a solution developed for Microsoft Office 2003 still works on the 2007 Microsoft Office system.

Installation pitfalls

A. Do you have administrator privileges? The account used to install the PIAs must have administrator privileges.

B. Is the .NET Framework already installed? The computer must have a version of the .NET Framework installed (version 1.1, 2.0, 3.0, or 3.5) before the PIA installer is run. Windows XP does not include any version of the .NET Framework unless .NET 1.1 was downloaded from Windows Update. Windows Vista does include a version of the .NET Framework. When Microsoft Office is first installed, the .NET Framework installation is detected and the PIAs are automatically installed.

C. Is Business Contact Manager installed? If Outlook 2007 with Business Contact Manager is already installed on the computer, you may see the following error message when you install the Primary Interop Assemblies for the 2007 Microsoft Office system from the Microsoft Download Center:

Error 1316: Setup cannot read from file {PATH}\PIARedist.MSI. Check your connection to the network, or CD-ROM drive. For other potential solutions, see SETUP.CHM.

Business Contact Manager for Outlook 2007 installs the PIAs by default, and the file name is PIARedist.MSI.  However, the file from the Microsoft Download Center is called o2007pia.msi.  When you install the PIAs from the Microsoft Download Center, this name conflict causes the 1316 error.

The easiest thing to do here is to just ignore the error, because this message means that the PIAs are already installed. If you want to correct the error, uninstall the PIAs through the list of installed programs for the specific computer. Then you can reinstall the PIAs with the Primary Interop Assemblies for the 2007 Microsoft Office system from the Microsoft Download Center.

I don't recommend that you follow the workaround posted at Error 1316 when installing Office 2007 PIA’s, which changes the name of the o2007pia.msi file to piaredist.msi and updates the product.xml to point to piaredist.msi.  If you change the name of the o2007pia.msi, anyone that installs the PIAs after you will experience the 1316 error.

If you discover other PIA pitfalls, please feel free to leave a comment or question so I can update this entry.  Thanks for reading!

Mary Lee, programming writer.

Leave a Comment
  • Please add 2 and 4 and type the answer here:
  • Post
  • When you use ClickOnce in Visual Studio 2008 to deploy your Office solution, you can include prerequisites

  • How can I use Office 2007 (Daily use, not for programming), but program using office 2003 PIA's. Once office 2007 is installed, my computer default all PIA's to 2007, no matter how much I try to uninstall them (hard), or install in new sequences (office 2007 first, then 2003).

  • hi Anders,

    you cannot install multiple versions of Microsoft Office on a development computer - for precisely the reasons that you noticed.  from http://msdn.microsoft.com/en-us/library/bb398242.aspx

    "Visual Studio Tools for Office does not support installing Microsoft Office 2003 and the 2007 Microsoft Office system (or different versions of the same application, such as Word 2003 and Word 2007) side-by-side on the development computer. To develop solutions for different versions of Microsoft Office, use a different development computer for each version of Microsoft Office."

    installing the PIAs also installs binding redirects, which always point to the latest version of the PIAs.  this enables Office 2003 add-ins and customizations to work in future versions of Office.  

    for more background, see the following blog entry from a VSTO architect: http://blogs.msdn.com/andreww/archive/2007/06/08/why-is-vs-development-not-supported-with-multiple-versions-of-office.aspx

    m.

  • I have VS2005 Pro installed. I also have Office 2003. The PIA's show up in the GAC, but not when I try to add a reference in VS. I have .Net Framework 2.0.

    I have tried reinstalling both VS and Office in different orders. I have also tried the fixes recommended by MSDN.

  • I have installed the 2007 PIA and repaired my Office 2007 installation.

    Still, when I add a reference to the Office 12 Object Library in VS2005, I only see Office.Core and cannot add an 'imports' statement for Office.Interop

    Have checked that Windows\assembly\gac\ has got the interop dlls

  • The core "Office" PIA (which is what your project references when you add a reference to the "Microsoft Office 12.0 Object Library"; this PIA defines types used in all Office applications) contains only the 'Microsoft.Office.Core" namespace. You can verify this by viewing the contents of this PIA assembly in Object Browser after you reference it in your project.

    I am not aware of any "Office.Interop" namespace in any of the Office PIAs, but the PIAs for individual Office applications do have namespaces in the format "Microsoft.Office.Interop.<app name>". For example, if you add a reference to the Microsoft Excel 12.0 Object Library, the namesapce of the types in this PIA is "Microsoft.Office.Interop.Excel". Does this help?

  • Since the product.xml file in the Office2007PIARedist does not contain a Homesite like other Microsoft packages, what is the recommended way to fix or suppress the build warning?

    MSB3164

    "No 'HomeSite' attribute has been provided for 'Microsoft Office 2007 Primary Interop Assemblies', so the package will be published to the same location as the bootstrapper."

  • Tom,

    to fix this, you can select Download prerequisites from the same location as my application radio button or uncheck the PIAs from the Prerequisites Dialog Box.  you should only do the latter if the PIAs are already installed.

    m.

  • Thank you for the quick response.

    I was afraid you were going to say that as unfortunately that isn't practical.  I can't imagine a business case to not check the "Download prerequisites from component vendor's web site" and you are correct that we can not assume our clients already have the office PIAs installed.

    Has there been any discussion at Microsoft about adding a valid office homesite?

    Correct me if I'm wrong, but if "Download prerequisites from component vendor's web site" is checked for the office package, it simply ignores the flag and finds them from the local location.

    Is there a way to explicitly specify this behavior so that functionally it is equivalent without actually having that warning?

    All of our attempts to suppress that warning in the project are ignored by msbuild.  It is entirely possible we are doing something wrong, but the only proposed work around we have come up with which is functionally equivalent would be to build the project in a batch file and return a passing state if just this warning appears - which seems rather extreme to avoid a warning and a really poor build design.

  • I'm trying to create a setup project using Visual Studio 2008 SP1 that will install the PIAs as a prerequisite.

    In the prerequisites screen, Microsoft Office 2007 Primary Interop Assemblies is a checkbox option - but after selecting this and building the project, the PIA installation does not run when running the setup.exe.

    Looking in the Office2007PIARedist folder there is only a o2007pia.msi, but this is not being run.

    .Net framework is installed on the machine.

    Am I missing a step when building my project?

  • I have a few comments relating to ComponentCheck.exe here: http://blogs.msdn.com/rcook/archive/2009/03/12/issues-with-office-2007-pia-redist-and-componentcheck-exe.aspx

  • Hi, hope you can help me here.  I've a VB.Net program that creates an Excel 2007 file.  It works well on my computewr since Office 2007 is installed.  I need to deploy the program in our production server wherein there is no MS Office installed.  I created a package which includes the InterOp assemblies but I always get the error that the ActiveX component couldn't be created.  I tried registering the DLLs using regsvr32 (fails) and regasm (successful but useless) but still got the same error when I run the application.  Has anyone deployed a VB.Net program that uses Office 2007 InterOp Assemblies on a server that has no Office installed?

  • Hello Developers,

    I'm trying do develop an Addin, and I'm having some problems with PIA's. This Addin is directed to MS Project 2007 but I wanted to export my Data to MS Excel 2003. After I've tried and broke my head among the references and didn't found a solution.

    I'm wondering, since Ms Project 2007 use PIA 12.0 and MS Excel use PIA 11.0 I think Visual Studio 2008 can't have references for both PIA (which is normal).

    Do I have to develop the Addin to diferent cases (eg: 1 Addin to Ms Project 2007 with Ms Excel 2007 and another to MS Project 2003 with Ms Excel 2003)?

    Is it possible to mix up to Kinds of version (eg: 1 Addin to Ms Project 2007 with Ms Excel 2003 and another to MS Project 2003 with Ms Excel 2007)?

    I really appreciate your help,

    Best Regards,

    Mask

  • Hi. I have developed an application using Office12.  However, the target PC's have office 2003 or Office Xp installed.  When I install the application and try to run it It errors.  I think it is to do with me using Office 2007 reference.  Is there a way of getting my application to work without having to change my code to reference the Office XP or Office 2003 COM references?

  • Hi Luihond -

    If you use Visual Studio 2005 or Visual Studio 2008 to target your solution for Office 2007, then you should expect it to error and not run on older versions of Office.  In order to target Excel 2003, you would need to create a new project, and then you can probably copy and paste most of your code into the new project.  The VSTO tools do not target Office XP.  

    Sincerely,

    Christin Boyd

    Program Manager

    Visual Studio

Page 1 of 3 (42 items) 123

Common Pitfalls during PIA Deployment and Installation (Mary Lee)