Skip to content

(bug): fixed nuget references for ci failure - #59

Merged
drmoisan merged 6 commits into
developmentfrom
bug/ci-failure-#2
Mar 11, 2026
Merged

(bug): fixed nuget references for ci failure#59
drmoisan merged 6 commits into
developmentfrom
bug/ci-failure-#2

Conversation

@drmoisan

Copy link
Copy Markdown
Owner

No description provided.

…error

The TaskMaster VSTO add-in project has SignManifests=true with a developer
certificate thumbprint. In CI (GitHub Actions), this certificate is not
installed, causing the build to fail with:

  error : Cannot find the certificate that matches the project system thumbprint.

Fix: In Directory.Build.targets, the SetTaskMasterManifestCert target now
conditionally sets SignManifests=false when the CI environment variable is
'true' (automatically set by GitHub Actions), overriding the static project
property before ResolveKeySource runs.

Closes the Build with analyzers and code style enforcement CI failure.
VSTO add-in projects require SignManifests=true — there is no option to
disable ClickOnce manifest signing. Setting SignManifests=false (previous
attempt) caused a second CI error:

  error : Cannot build because the ClickOnce manifest signing option is
  not selected.

Fix:
- ci.yml: add 'Generate ephemeral VSTO signing certificate' step that
  calls New-SelfSignedCertificate, installs the cert to CurrentUser\My,
  and writes its thumbprint to GITHUB_ENV as CI_CERT_THUMBPRINT.
- Directory.Build.targets: when CI=true, keep SignManifests=true and
  substitute the developer thumbprint with \, which
  MSBuild resolves from the environment variable set by the step above.

Developer builds are unchanged: the developer thumbprint is still used
when CI is not set.
…same process

Root cause of CI #6 failure:
Out-File in PowerShell uses UTF-16 encoding by default. GitHub Actions reads
GITHUB_ENV as UTF-8, so CI_CERT_THUMBPRINT was never parsed correctly. MSBuild
received an empty thumbprint, triggering the 'cannot find certificate' error.

Fix:
- Directory.Build.targets: scope SetTaskMasterManifestCert to non-CI builds
  (added 'and $(CI) != 	rue' to the Target condition). A target-scoped
  PropertyGroup runs at execution time and would override a command-line
  /p:ManifestCertificateThumbprint value, so the target must not run in CI.
  Developer builds are unchanged.

- ci.yml: remove the standalone cert-gen step that relied on GITHUB_ENV.
  Instead, create the ephemeral self-signed certificate and invoke MSBuild in
  the same PowerShell process for both build steps. The thumbprint stays in
  a local variable with no inter-step transfer, eliminating the encoding
  issue entirely. The nullable build step looks up the cert by subject so it
  does not need to create a second certificate.
…d cert errors

All three prior CI failures stemmed from Microsoft.VisualStudio.Tools.Office.targets
which requires Office PIAs and a developer signing certificate not available on
CI runners.  Instead of patching individual symptoms:

- TaskMaster.csproj: add '$(CI)' != 'true'' to Office.targets import condition
  so FindRibbons, manifest signing, and ClickOnce targets are skipped entirely.
- Directory.Build.targets: add top-level PropertyGroup that sets
  SignManifests=false and SignAssembly=false when CI=true, preventing
  ResolveKeySource in Microsoft.Common.targets from seeking the cert.
- ci.yml: remove ephemeral certificate creation since it is no longer needed.

Local developer builds are unaffected (CI env var is not set).
@drmoisan
drmoisan merged commit fb28009 into development Mar 11, 2026
2 checks passed
@drmoisan
drmoisan deleted the bug/ci-failure-#2 branch March 11, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant