Spotfire Developer Documentation

Creating a Spotfire extension in Visual Studio

This task demonstrates creating a Microsoft Visual Studio project that is based on the Spotfire extension project using the Spotfire Extension.zip template.

About this task

Perform this task in Visual Studio.

Before you begin

You must have installed the zipped Spotfire extension project templates into the Visual Studio templates folder.
Note: If you do not specifically want to use the graphical Package Builder tool, you can instead stay in Visual Studio for the whole process. Then, you use other templates to create your project. See Creating an extension using only Visual Studio for more information.

Procedure

  1. In Visual Studio, select File > New > Project and select the Spotfire Extension.zip or Spotfire Extension Net6.zip template. This example uses the Spotfire Extension.zip template. Note that the Spotfire Extension Net6 template is an SDK-style project and it allows you to build for multiple platforms at the same time. For the templates to work out-of-the-box, the location of the new project must be in the MyExtensions folder in the SDK (or another folder at the same level). If you decide to store your extension somewhere else, some paths must be changed or updated.
    In the Create a new project dialog, provide the appropriate information in the Project name, Location, and Solution name fields, and select Place solution and project in the same directory before clicking Create.

    Visual Studio creates the solution for the extension project.
  2. In Solution Explorer, select the project name, and from the Properties window, make a note of the project folder.
    Example: C:\Spotfire SDK\SDK\MyExtensions\Spotfire Extension\Spotfire Extension\ .
  3. In Solution Explorer, expand References and check whether any of the Spotfire Developer assembly references are broken.
    If the references are good, the project was successfully created. If not, complete steps 4 through 6.

    Project showing broken references

  4. If any assembly references are broken, right-click the extension in Solution Explorer and select Properties.
  5. In Properties, select the Reference Paths section.
  6. In Reference Paths, add the path to the applicable Binaries directory of the SDK (there are different folders available depending on which .NET you develop for; in this example the path used is {SDK base directory}\Spotfire SDK\{version}\SDK\Binaries\net48), and click Add Folder.
    Once the reference path has been updated, the broken references should be gone.
  7. From the Solution Configurations drop-down list, select Debug and then build the solution.
    The default example solution should build without errors or warnings; if not, follow steps 8 through 10.
  8. In Solution Explorer, right-click the extension, and from the menu, click Properties.
  9. In Properties (under Application or Build), ensure that you select the correct .NET framework version for the build. (For Spotfire version 11.5 and later, this should be .NET framework version 4.8 or later).
  10. Build the solution and verify that the example builds without errors or warnings.
  11. From the Build section, make a note of the Output path.
    When you add the Spotfire extension to the Spotfire Package Builder, you reference it using the project folder appended with the Output path.
    Visual Studio Build properties output path

    Note: SDK-style projects look different than this example, see the example below. There can also be differences depending on which version of Visual Studio you use.
    Example: C:\Spotfire SDK\SDK\Examples\Extensions\SpotfireDeveloper.CustomVisualsExample\bin\AnyCPU\Debug\.

Results

The template project should be successfully created in Visual Studio.

Creating an extension using the SDK-style template

This example demonstrates creating a Microsoft Visual Studio project that is based on the Spotfire extension project using the Spotfire Extension Net6.zip template. This template is used to create projects that can run on both target frameworks, and, hence, both Windows and Linux platforms.

  1. Create a new project using the template.

    Note that there are two target frameworks specified in the Properties for the extension.

  2. Go to Debug and click Open debug launch profiles UI.
  3. In the Launch Profiles dialog, click Create a new profile , and choose Executable.
  4. For your new profile, browse to the path to the Spotfire.Dxp.exe to run. It could be your installed version, some intermediate beta-version or similar. For example, C:\Users\{username}\AppData\Local\Spotfire\12.0.0\Spotfire.Dxp.exe.
  5. Close the dialog.
  6. Choose your new profile from the drop-down list and run the project.