Skip to content

Ensure signed 3P DLLs are included in publish output - #685

Merged
embetten merged 1 commit into
releases/2.0.3from
users/embetten/fix-3p-signing
Jun 5, 2026
Merged

embetten merged 1 commit into
releases/2.0.3from
users/embetten/fix-3p-signing

Conversation

@embetten

@embetten embetten commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

dotnet publish --no-build resolves 3P NuGet dependencies (Newtonsoft.Json.dll, PowerArgs.dll) from the global NuGet cache rather than from OutDir. MicroBuild signs these DLLs in-place in OutDir during build, but publish never picks up those signed copies β€” resulting in unsigned 3P binaries in tarballs/zips.

Additionally, Add3rdPartyFilesToSign had DependsOnTargets='Build' which caused a circular dependency (MSB4006).

Fix

  1. Add CopySignedDepsToPublish target (AfterTargets='Publish') that copies the MicroBuild-signed 3P DLLs from OutDir over the unsigned copies in PublishDir. Only runs when SignType is set (official builds).
  2. Remove DependsOnTargets='Build' from Add3rdPartyFilesToSign β€” BeforeTargets='SignFiles' alone is sufficient and avoids the circular dependency.

Verification

  • Build succeeds locally (0 errors)
  • Confirmed VSIX artifact from pipeline build contains properly Authenticode-signed Newtonsoft.Json.dll and PowerArgs.dll
  • Tested locally: tampered OutDir DLL, then published β€” publish folder received the OutDir copy (not NuGet cache), proving the target works

@embetten embetten changed the title Fix 3P signing: remove circular dependency and copy signed DLLs to publish Ensure signed 3P DLLs are included in publish output Jun 5, 2026
…blish

- Remove DependsOnTargets='Build' from Add3rdPartyFilesToSign to fix
  MSB4006 circular dependency (BeforeTargets='SignFiles' is sufficient)
- Add CopySignedDepsToPublish target to overwrite unsigned 3P DLLs in
  publish output with signed copies from OutDir (only runs when SignType set)
@embetten
embetten force-pushed the users/embetten/fix-3p-signing branch from 56005e9 to 0b35f37 Compare June 5, 2026 20:03
@embetten
embetten merged commit 99d9186 into releases/2.0.3 Jun 5, 2026
55 checks passed
@embetten
embetten deleted the users/embetten/fix-3p-signing branch June 5, 2026 21:16
embetten added a commit that referenced this pull request Jun 8, 2026
## Problem
`dotnet publish --no-build` resolves 3P NuGet dependencies
(Newtonsoft.Json.dll, PowerArgs.dll) from the global NuGet cache rather
than from OutDir. MicroBuild signs these DLLs in-place in OutDir during
build, but publish never picks up those signed copies β€” resulting in
unsigned 3P binaries in tarballs/zips.

Additionally, `Add3rdPartyFilesToSign` had `DependsOnTargets='Build'`
which caused a circular dependency (MSB4006).

## Fix
1. Add `CopySignedDepsToPublish` target (`AfterTargets='Publish'`) that
copies the MicroBuild-signed 3P DLLs from OutDir over the unsigned
copies in PublishDir. Only runs when `SignType` is set (official
builds).
2. Remove `DependsOnTargets='Build'` from `Add3rdPartyFilesToSign` β€”
`BeforeTargets='SignFiles'` alone is sufficient and avoids the circular
dependency.

## Verification
- Build succeeds locally (0 errors)
- Confirmed VSIX artifact from pipeline build contains properly
Authenticode-signed Newtonsoft.Json.dll and PowerArgs.dll
- Tested locally: tampered OutDir DLL, then published β€” publish folder
received the OutDir copy (not NuGet cache), proving the target works
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.

2 participants