# COZYROC Pygmy SSMS 22 Extension

This VSIX adds **View in Pygmy** to SSISDB project and package nodes in SSMS 22 Object Explorer.

## Prerequisites

- SSMS 22.x (amd64)
- Visual Studio 2022 (or Build Tools 2022) with MSBuild 17.x and VS SDK targets
- .NET SDK (for web asset publish step) and Node.js 20+

## Build locally

1. Generate embedded web assets:

```bash
cd SsmsPygmyExtension
node scripts/prepare-webview.mjs
```

2. Build VSIX:

```bash
msbuild SsmsPygmyExtension/SsmsPygmyExtension.csproj -t:Restore -p:Configuration=Release
msbuild SsmsPygmyExtension/SsmsPygmyExtension.csproj -p:Configuration=Release
```

The VSIX now installs per-user by default for local development, so SSMS can load it from your user extension folder without admin rights.

`Debug` now syncs the built extension payload into an already-installed SSMS extension folder instead of reinstalling the VSIX. This updates the runtime DLLs, generated `.pkgdef`, and bundled web assets in place. SSMS must be closed. The sync prefers the per-user SSMS extension folder and falls back to a machine-wide install if that is the only one present.

The VSIX is produced in:

- `SsmsPygmyExtension/bin/Release/*.vsix`
- `SsmsPygmyExtension/bin/Debug/*.vsix`

## Install / uninstall

- Install or reinstall with SSMS closed:

```powershell
& "C:\Program Files\Microsoft SQL Server Management Studio 22\Release\Common7\IDE\VSIXInstaller.exe" "C:\Users\ivanm\source\repos\ssis-package-viewer\SsmsPygmyExtension\bin\Debug\SsmsPygmyExtension.vsix"
```

- Use `VSIXInstaller.exe` when:
  - installing the extension for the first time
  - changing package registration such as manifest metadata, option pages, or other VSIX/package registration
  - switching cleanly between installed builds
- For normal runtime-only iteration, build `Debug` with SSMS closed. That updates the already-installed extension in place without a reinstall.
- Uninstall: `VSIXInstaller.exe /uninstall:SsmsPygmyExtension.26F4E5D8-5561-4229-8350-3219DBE42AEF`.

## Troubleshooting

- `View in Pygmy` not shown: verify the selected node is under `SSISDB -> Projects -> <project>` or a package under that project.
- Web viewer missing message: rerun `node SsmsPygmyExtension/scripts/prepare-webview.mjs` before build.
- `catalog.get_project` errors: ensure the active SSMS login has execute/read permissions in SSISDB for the selected folder/project.

## Notes

- Supports SSMS 22 only (`[22.0,23.0)`).
- Uses the active SSMS Object Explorer connection context.
- Package command loads project payload and locks selection to the selected package entry.
