param([Parameter(Mandatory=$true)][string]$CertificateThumbprint) $ErrorActionPreference='Stop' Write-Output 'For the complete update/test/package workflow use Update-WordCompanion.ps1. This legacy build helper also omits Office registration.' $root=Split-Path $PSScriptRoot -Parent $vswhere=Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe' $msbuild=& $vswhere -latest -requires Microsoft.VisualStudio.Workload.Office -find 'MSBuild\**\Bin\amd64\MSBuild.exe' | Select-Object -First 1 if(!$msbuild){throw 'Visual Studio MSBuild with Office/VSTO development tools is required.'} $project=Join-Path $root 'Vsto\PlotDirector.WordAddIn.csproj' & $msbuild $project /restore '/t:Build;VisualStudioForApplicationsBuild' /p:PrepareForRunDependsOn=CopyFilesToOutputDirectory /p:Configuration=Debug /p:SignManifests=true "/p:ManifestCertificateThumbprint=$CertificateThumbprint" if($LASTEXITCODE -ne 0){throw 'VSTO build failed; do not register or install the add-in.'} $agent=Join-Path $root 'Vsto\bin\Debug\Agent' dotnet publish (Join-Path $root 'Agent\PlotDirector.Companion.Agent.csproj') -f net10.0-windows10.0.19041.0 -c Debug -r win-x64 --self-contained false -o $agent if($LASTEXITCODE -ne 0){throw 'Agent publish failed.'} Write-Output 'Developer outputs prepared only. Review/trust the signed test manifest in Visual Studio. No installation or automatic update was performed.'