Share via


Registering the Host Application

You must register your host application on the development computer before you can generate project templates and use the project templates in the integrated development environment (IDE). To register the host application, you create several registry keys that provide information about your host application.

When you deploy Visual Studio Tools for Applications along with your host application, the Visual Studio Tools for Applications Windows Installer package performs some of the registration steps for you. For more information, see Registering the Application on End User Computers.

Host Registry Keys

Visual Studio Tools for Applications uses two areas in the registry to store information about your host application and to distinguish host applications from one another: the host configuration registry key, and the host context registry hive. You are responsible for creating subkeys for your application under the host configuration key. Visual Studio Tools for Applications automatically generates the host context hive for you.

Host Configuration Key

The host configuration registry key stores the identifier for the host application, the location of project templates, and other settings. For more information, see Host Configuration Registry Key Settings.

The host configuration key is located in one of the following registry locations:

  • On 32-bit platforms: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSTAHostConfig

  • On 64-bit platforms: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSTAHostConfig

To register your application, you must create a hostID\2.0 subkey under the host configuration key. The hostID key identifies your host application, and the 2.0 key specifies the version of Visual Studio Tools for Applications that you are integrating with the application. When you integrate Microsoft Visual Studio Tools for Applications 2.0 with an application, you must use 2.0 for the name of this key. For example, the ShapeAppCSharp sample uses the following host configuration subkey on a 32-bit platform.

HKEY_LOCAL_MACHINE\Software\Microsoft\VSTAHostConfig\ShapeAppCSharp\2.0

For the steps to create this key, see How to: Register the Host Application.

Host Context Hive

The host context hive stores information about IDE settings, project templates, and other data relevant to your host application. When you run vsta.exe with the /hostid and /setup command-line arguments, Visual Studio Tools for Applications uses entries that you added to the host configuration key to generate the host context hive. You should not edit the host context hive directly. For the steps to create this registry hive, see How to: Register the Host Application.

The host context hive is located in one of the following registry locations:

  • On 32-bit platforms:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSTAHost

  • On 64-bit platforms:

    HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\VSTAHost

When you register your application, Visual Studio Tools for Applications generates an additional hostID\9.0 subkey under the host context hive. The hostID key identifies your host application, and the 9.0 key specifies the version of the Visual Studio Tools for Applications IDE that you are integrating with the application. When you integrate Microsoft Visual Studio Tools for Applications 2.0 with an application, you must use 9.0 for the name of this key. 9.0 refers to the version of Visual Studio that the IDE provided by Microsoft Visual Studio Tools for Applications 2.0 is based on.

For example, the ShapeAppCSharp sample uses the following subkey on a 32-bit platform.

HKEY_LOCAL_MACHINE\Software\Microsoft\VSTAHost\ShapeAppCSharp\9.0

Regenerating the Host Context Hive After Changing Host Configuration Settings

If you change configuration settings for the host application on the development computer after you register the host application, you must update the registry entries that contain this data (for example, if you change the location of Visual Studio Tools for Applications project templates, you must update the ProjectTemplatesLocation entry). Then, you must update the registration by regenerating the host context hive. For the steps to update the registration, see How to: Update the Registration for the Host Application.

Registering the Application on End User Computers

The Visual Studio Tools for Applications SDK includes an installer package (vsta20.exe) that you can run from your application's Setup program to install the Visual Studio Tools for Applications IDE and runtime assemblies on end user computers. Your Setup program must create the host configuration registry key on the end user computer, but vsta20.exe performs the rest of the registration for you:

  • If your Setup program passes the HOSTID=host ID argument to vsta20.exe, it runs vsta.exe (that is, the executable program for the Visual Studio Tools for Applications IDE) with the /hostid and /setup arguments to create and populate the host context registry hive.

  • If the end user computer already has Visual Studio 2008 installed, vsta20.exe also runs devenv.exe with the /setup argument to install any included Visual Studio templates to the appropriate folders.

For more information, see Deploying the IDE and Runtime.

See Also

Tasks

How to: Register the Host Application

How to: Update the Registration for the Host Application

Concepts

Host Configuration Registry Key Settings

Configuring the IDE