Visio 2003 Developer's Survival Pack

NETVSL Adapter: Installation and Deployment Notes
NETVSL home   This page

Overview

This page discusses installation of the sample components. Because this covers the steps for installing and registering, it also functions as the details you'll need to know for configuring an installation of your own components for deployment.

Download

Start by downloading the zip file, and unzip in any directory location that's suitable for (a) working on source code in VS.NET, and (b) is a good location for registered components. (So probably on removable media is not a good choice.)

If you don't have the zip file already, see bottom of page for download link.

Installation Overview

Details below.

Where to Find What Files

The following chart has the details:

Kind of component Directory Specific Item Details
Adapter NETVSL_Adapter NETVSL_Adapter_signed.vsl This is the actual adapter.
NETVSL_Adapter_unsigned.vsl This is the same adapter, but not digitally signed. You can sign this with your own certificate, or use it to test Visio's behavior with unsigned vsl.
NVTest_Test01.vsl
NVTest_ColorInc.vsl
NVTest_TwoAddons.vsl
Here are some copies of the adapter, already renamed to work with the provided sample .NET dlls. So just copy these to a directory where Visio looks for VSLs as described above.
.NET Sample VSL functionality NETVSLLib\ NVTest_Test01 NVTest_Test01 A C# project that builds a very basic object the satisfies the INETVSL interface.  (Install using GACnReg procedure.) Though it registers an Addon with Visio, that Addon doesn't do anything. This sample is mostly useful for (a) exercising the adapter and its debug window, and (b) test calling the component from VBA (ie: not as a VSL), which is demo'd in the included  NVTest_Test01_CallFromCOM.vsd. So, not necessarily the demo to start with, but the most rudimentary example.
NETVSLLib\ NVTest_ColorInc NVTest_ColorInc A simple demo that actually does something.  (Install using GACnReg procedure.) Use ColorInc_Test.vsd to test. Addon reads shape's fill color, increments it, and also writes Run arguments to shape's Text.  Although this is an example of real VSL+Addon functionality, it doesn't employ the mini VSL Addon framework that's also included in this kit. So use this sample if you are building something very simple only.
NETVSLLib\ NVTest_TwoAddons NVTest_TwoAddons (Install using GACnReg procedure.) This demo is more complete, and shows how to use the TNETVSL_Base and TNETVSL_Addon classes, and other helpers, to build a VSL that includes multiple Addons (in this case 2), shows Windows.Forms forms (with and without using WinAPI functions to coordinate with Visio's window) and so on.
Open NVTest_TwoAddons_Test.vsd to exercise.
You may want to start a new project by copying files from TwoAddons as a starting point for a new VSL and addons.
Source Code Components NETVSLLib\ NETVSL_Common NETVSL_Types.cs This file contains the authoritative definition of the INETVSL interface, and associated types. Don't edit this, but do include it (link to it) in VSL projects.
NETVSL_ArgHandler.cs Provides an object for parsing the "command-line" style arguments that Visio supplies to a VSL. Include (link to) this file in a VSL project if you want to use this facility. See TwoAddons sample for example how to use.
NETVSL_Util.cs Utility functions for NETVSL. Include (link to) this file in a VSL project if you want to use this facility.
NETVSL_WinAPI.cs API declarations for NETVSL. Include (link to) this file in a VSL project if you want to use this facility.
NETVSLLib\ NETVSL_Base NETVSL_Base.cs Defines TNETVSL_Base and TNETVSL_Addon classes, which implement most of the drudgery for a main VSL class/object (for the adapter to call), and some utility functionality, and then also a base Addon object to provide the basics of individual addons.
Your projects would link to this file, and inherit from TNETVSL_Base and TNETVSL_Addon. NVTest_TwoAddons demonstates this.
NETVSLLib\ NETVSL_Ref   This project is not particularly useful to you. It is simple a dummy project which I used in order to create a COM version of INETVSL, so that I could then import that when building the Adapter. Provided only for completeness.
       

Installation Details 1: Installing an Adapter

Copy the adapter (NETVSL_Adapter_signed.vsl) to a directory where Visio will look for VSLs. (See Visio > Tools > Options > Advanced > File Paths).

Rename this adapter to match the component offered by the .NET dll.

Example:: if .NET dll offers MySolution.NETVSL, then rename the adapter to MySolution.vsl.  There are already-renamed adapters in the NETVSL_Adapter directory.

Installation Details 2: .NET Components and the GACnReg Procedure

Installation of a .NET dll that supplies VSL solution functionality consists of a couple of main steps detailed in the table below. (This is in addition to installing the Adapter, as noted above).

Step Why How Wrinkles
Install dll into .NET Global Assembly Cache Because then COM Interop can find component with low hassle Use gacutil 1. You may want to uninstall prior version first.
2. You may read that you can just drag(copy) the dll to c:/Windows/assembly [Note 1] in Windows Explorer. This is true but doesn't translate into something you can put in a batch file, for example. That's because assembly is not a real directory, it only looks like one in Explorer, courtesy of a Shell addin. You can see what it really looks like by browsing to it using DIR in a command window.
3. To put a dll in the GAC, the component has to have a so-called "strong name". See details in code notes.
4. In theory, you don't have to put the component in the GAC, you can put it in the app's executable directory. I haven't explored that.
Register component for COM So that a COM-savvy caller can access the component like any other COM component Use regasm 1. Unregister previous version of component before disturbing the dll that's registered. Otherwise regasm's unregister procedure won't find all the keys in the registry to delete. Ie: regasm uses info in the DLL both to register various keys, and also to unregister. Consequently, if you recompile or delete the component that was registered, regasm can't delete all the keys.
Note 1. Yes, I know the slashes are backwards. For some reason FrontPage 2002 insists on turning just this filepath into a hyperlink  if I use backslashes. And there's no apparent way to disable AutoCorrect. But help does offer to tell us all about Hanja to Hangul conversion and how to buy addon proofing tools. Improving the productivity of users, feature by feature.

During development, you may want to perform this procedure many times. To smooth the path, I have created simple GACnReg.BAT files, which you can find in each project's bin\Debug directory.

That batch file also makes a backup copy of the dll into the "previous" directory, so that the dll that was previously registered can be used for unregistration (that dl doesn't get overwritten by recompiling).

Your deployment procedure would basically follow these same steps.

Download

See download page at:

http://www.diagramantics.com/v11dsp/support.htm

From Here

Go back up to the NETVSL home page, and possibly proceed to look at the code notes page.


Article Created: 2004-01-15  Last edit: Last edit: 04-02-24 Graham Wideman
Go to:
  DiagramAntics.com