Share via


Visio Update and PIA Issues

I received a question from a user the other day in regards to the samples contained in the Visio Managed Code Tutorial that shipped as part of the Visio 2003 SDK. Seems the user couldn’t compile the samples because Visual Studio couldn’t find the Microsoft.Office.Interop.Visio assembly. I suggested the user check and see if the Visio PIAs were actually installed, because they don’t always install by default (more on that later).

Turns out there may be more to it than that. The Visio test team did some research, and it seems that one of the Visio Update patches actually disables the Visio Interop PIA. Here’s what the test team found:

Installing the Microsoft Office Visio 2003 Update: KB831925 causes all the Tutorial samples to fail compiling. When you open the Tutorial samples in Visual Studio, Visual Studio fails to find the Visio Interop PIA. To fix this problem, open Visio 2003, and from the Help menu, choose Detect and Repair.

Note: Just starting the Visio application does not launch a repair operation in this case.

So even if you know you installed the PIAs previously, it might be a good idea to repair them via the method above if you’ve downloaded the update.

(My thanks to Curt on the Visio test team for running this problem down. Great work, Curt.)

This issue will be written up in the Knowledge Base, but since the user asked the question here, I figured I’d go ahead and answer it here.

Here’s how Visio PIA installation usually works:

If you install Visio on a computer that does not have Visual Studio 2003 (version 7.1) or the .Net Framework 1.1 installed, then Visio doesn’t install the PIAs. If Visual Studio or the .NET Framework is already present on your computer when you install Visio, then the Visio PIAs are installed by default.

Do the following to have Visio explicitly install the PIAs:

· From the Start menu, click Settings, click Control Panel, then Add or Remove Programs.

· In the program list, select Microsoft Office Visio 2003, and click the Change button. Click Add or Remove Features, and then click Next.

· Expand the Microsoft Office Visio icon and select .NET Programmability Support, and then click Update. You may want to try uninstalling this and then reinstalling to force it to install.

One way to check to see if the PIAs are installed is to navigate to your windows directory in explorer, e.g.

c:\windows\assembly

c:\winnt\assembly\

and see if you see the Visio PIAs for Visio version 11 in the list of assemblies. There are three PIAs for Visio. The primary one is Microsoft.Office.Interop.Visio.

Note If you install an add-in when the Visio PIAs are not installed, you must re-install the add-in after you install the Interop PIA (in other words, just installing the PIAs is not enough to fix the add-in.)