Adding the Office Primary Interop Assemblies as a Prerequisite in your ClickOnce installer (Mary Lee)

Rate This
  • Comments 47

When you use ClickOnce in Visual Studio 2008 to deploy your Office solution, you can include prerequisites such as the .NET Framework 3.5, the Visual Studio Tools for Office system 3.0 Runtime, and Windows Installer 3.1.  However, the primary interop assemblies (PIAs) for the 2007 Microsoft Office system are not automatically listed in the Prerequisites dialog box. 

Fortunately, you can add the PIAs to the Prerequisites dialog box. The following procedure adds the 2007 Microsoft Office Primary Interop Assemblies to the Prerequisites Dialog Box. This procedure may look lengthy, but you only have to do it once.

1.  Download the OfficeVSTO2005SEWindowsInstallerV3.msi sample, which is part of the deployment whitepaper at Deploying Visual Studio 2005 Tools for Office Second Edition Solutions Using Windows Installer (Part 1 of 2).

2. Install OfficeVSTO2005SEWindowsInstallerV3.msi.

3. Copy the contents of %ProgramFiles%\Microsoft Visual Studio 2005 Tools for Office SE Resources\VSTO2005SE Windows Installer Sample Version 3\packages to %ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages

4. Compile the component checker. This step checks if the computer has the correct version of Office installed to match the PIAs that are being installed.

a) Open a Visual Studio command prompt

b) Change directories to %ProgramFiles%\Microsoft Visual Studio 2005 Tools for Office SE Resources\VSTO2005SE Windows Installer Sample Version 3\projects\Checks

c) Type the following command: cl.exe /Oxs /MT /GS ComponentCheck.cpp advapi32.lib

d) Copy ComponentCheck.exe to the %ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Office2007PIA folder and the %ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Office2003PIA folder.

5. Download and extract the Office 2007 PIAs from 2007 Microsoft Office System Update: Redistributable Primary Interop Assemblies.

6. Copy the o2007pia.msi file to the %ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Office2007PIA folder.

7. In VS2008, on the Project menu, click ProjectName Properties.

8. Click the Publish tab.

9. Click the Prerequisites button to open the Prerequisites dialog box.

You should see the PIAs listed in the Prerequisites dialog box like the following image. Because the package.xml file does not define a HomeSite (a location to download the file), you will see a build warning.  Even if you have selected Download prerequisites from the component vendor's web site, the PIAs will go into a directory alongside your solution installer.


If you want to learn more about adding your own entries to the Prerequisites dialog box, see Adding Custom Prerequisites.

For more information about common problems when deploying the Office primary interop assemblies, see

For troubleshooting assistance, try the VSTO Power Tools, a suite of tools to help you develop and deploy Office solutions. For example, you can use the VSTO Troubleshooter to examine end user computers for missing prerequisites.

Mary Lee, programming writer.

Leave a Comment
  • Please add 3 and 1 and type the answer here:
  • Post
  • British reporters are known for doing almost anything to get a Mulberry Bags. But reports that a newspaper secretly listened to telephone messages of murdered schoolgirls and other private citizens have produced Mulberry Handbags and anger.

    On Friday, British police arrested Andy Coulson, former editor of Mulberry Bag Britain's best-selling newspaper, News of Mulberry Outlet the World. The investigation led him to Mulberry UK Sale resign in January as communications director to Prime Minister David Cameron.

    The arrest came in a widening investigation of Mulberry UK telephone hacking. Other accusations include paying police for mulberry shoulder bags information on stories. The Reuters news agency reported that Mr. Coulson was released on Mulberry Bag UK until a date in October.

    Prime Minister Cameron promised Men's Mulberry Bags Friday that a judge will lead a full public inquiry into Women's Mulberry Bags the case after police complete their investigation.

    DAVID CAMERON: "Murder victims, terrorist victims, families who have lost loved ones, sometimes defending our country, that these people could have had their phones hacked into, in order to generate stories for Mulberry Bags  Mulberry Handbags  Mulberry Bag   Mulberry Outlet  Mulberry UK  mulberry bayswater bag  Mulberry Alexa Bag, is simply disgusting."

  • The link for OfficeVSTO2005SEWindowsInstallerV3.msi does not work anymore. I would like to download the ComponentCheck.cpp for Office 2003 PIAs, is there any other source where i could download it?

Page 4 of 4 (47 items) 1234

Adding the Office Primary Interop Assemblies as a Prerequisite in your ClickOnce installer (Mary Lee)