"Unable to add the View registration" Error in Spotfire Software Development Kit (SDK)

"Unable to add the View registration" Error in Spotfire Software Development Kit (SDK)

book

Article ID: KB0070240

calendar_today

Updated On:

Products Versions
Spotfire Developer All supported versions

Description

Issue: 
Users may encounter the following error when working with Spotfire's Software Development Kit (SDK):
 

InvalidOperationException at Spotfire.Dxp.Framework:Unable to add the View registration. 
The combination of View Base Type: 'System.Windows.Forms.Form', Model Object Type: ‘<Model>’ 
and View Type: ‘<PromptForm>’ has already been registered. (HRESULT: 80131509)
 

This error indicates a duplicate registration of the same view base type, model object type, and view type within Spotfire. This typically occurs when the same custom extension or package is loaded more than once.

Cause:

The issue arises due to duplicate deployments of a Spotfire package. This can happen if:

- The same package is installed multiple times.
- There are multiple versions of the same package causing conflicts.
- A previous version of a package wasn’t correctly uninstalled or removed.

Issue/Introduction

This article explains why users encounter "Unable to add the View registration" error when working with Spotfire's Software Development Kit (SDK), and suggests a way to resolve it.

Environment

All supported operating systems

Resolution

One effective way to resolve this issue is by removing the problematic package from the Spotfire Modules folder. Here’s how to do it:

1. Ensure that Spotfire is not running before making changes to its files.
2. Go to the Modules Folder. Note that the Modules folder is typically hidden. (see Finding the Modules Folder in Spotfire Analyst Client for Package Building)

  • For a shared computer setup, this folder is located at C:\Program Files (x86)\TIBCO\Spotfire\<version number>\Modules.
  • For a single-user setup, this folder is similar to C:\Users\<username>\AppData\Local\TIBCO\Spotfire\<version number>\Modules.

3. Look for the folder or files related to the duplicate package. This could involve recognizing the name of the package or extension causing the error. Common folder names might include parts of the package name or the developer's name.
4. Delete the identified folder(s) or file(s) that correspond to the duplicate package.
5. Restart Spotfire.

Spotfire loads its extensions and packages from the Modules directory. By removing the duplicate package, you ensure that Spotfire only loads the necessary files once.

Additional Recommendations:

  • Before making any changes, it’s good practice to back up important files and directories.
  • Ensure that you have the latest version of all packages and Spotfire itself, as updates might include fixes for such issues.
  • Consider reviewing your deployment process to avoid future occurrences of duplicate package registrations. Maintain a clear versioning and update protocol.