Skip to content

Add ClickOnce manifest foundation - #1050

Open
dtivel wants to merge 7 commits into
mainfrom
dtivel/clickonce-manifest-foundation
Open

Add ClickOnce manifest foundation#1050
dtivel wants to merge 7 commits into
mainfrom
dtivel/clickonce-manifest-foundation

Conversation

@dtivel

@dtivel dtivel commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Part of #1049.

Summary

Add the dormant manifest foundation required by the ClickOnce signing algorithm version 2 specification.

  • Add typed application and deployment manifest abstractions, adapters, and readers.
  • Extract shared manifest behavior into ClickOnceManifestAdapter.
  • Use IReadOnlyList for resolution inputs and FileInfo for serialization destinations.
  • Fix metadata updates and serialization to use ManifestUtilities' v4.5 behavior, preserving SHA-256 digest values and declarations.
  • Always preserve the source manifest XML so elements and attributes not modeled by ManifestUtilities survive serialization.
  • Remove stale publisherIdentity and XML signature elements from the preserved XML before rewriting so regenerated signing metadata remains authoritative.
  • Read preserved XML with DTD processing prohibited and no XML resolver.
  • Redistribute the required MSBuild manifest runtime assemblies.
  • Verify that those assemblies are included in the Sign CLI package.
  • Add coverage for typed reads, manifest rejection, stream reuse, adapter contracts, metadata updates, application/deployment serialization, repeated writes, and preservation of unmodeled VSTO XML.

The preservation behavior is format-neutral. This PR does not classify manifests as ClickOnce or VSTO and adds no technology-specific API.

Behavior

The new implementation is dormant:

  • It is not registered with dependency injection.
  • It is not reachable from production signing.
  • It adds no CLI options or dispatch changes.
  • Existing ClickOnce version 1 behavior remains unchanged.

Testing

  • Focused ClickOnce manifest tests: 33 passed, 0 failed
  • Coverage verifies exact SHA-256 digest values and serialized SHA-256 DigestMethod declarations.
  • Preservation coverage verifies that unmodeled XML survives rewriting while stale publisher and signature metadata does not.

@dtivel
dtivel requested a review from kartheekp-ms August 8, 2026 21:25
@dtivel
dtivel requested a review from a team as a code owner August 8, 2026 21:25
Comment thread src/Sign.Core/Tools/ClickOnce/ApplicationManifestAdapter.cs
Comment thread src/Sign.Core/Tools/ClickOnce/ClickOnceManifestReaderProvider.cs Outdated
Comment thread src/Sign.Core/Tools/ClickOnce/ApplicationManifestAdapter.cs Outdated
Comment thread src/Sign.Core/Tools/ClickOnce/DeployManifestAdapter.cs Outdated
Comment thread src/Sign.Core/Tools/ClickOnce/ApplicationManifestAdapter.cs Outdated
@dtivel
dtivel force-pushed the dtivel/clickonce-manifest-foundation branch from e0f67a1 to 7429d45 Compare August 11, 2026 02:09
@dtivel
dtivel requested review from kartheekp-ms and a balanced review from Copilot August 11, 2026 02:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds dormant typed ClickOnce manifest infrastructure for signing algorithm version 2.

Changes:

  • Adds typed readers, interfaces, and shared manifest adapters.
  • Enforces SHA-256 metadata updates and serialization via v4.5.
  • Packages required MSBuild runtime assemblies and adds comprehensive tests.
Show a summary per file
File Description
Directory.Packages.props Pins compatible MSBuild manifest utilities.
src/Sign.Core/Sign.Core.csproj Adds the manifest utilities dependency.
ApplicationManifestAdapter.cs Adapts application manifests.
ClickOnceManifestAdapter.cs Implements shared manifest operations.
ClickOnceManifestReader.cs Reads typed ClickOnce manifests.
DeployManifestAdapter.cs Adapts deployment manifests.
IApplicationManifest.cs Defines the application-manifest contract.
IClickOnceManifest.cs Defines common manifest operations.
IClickOnceManifestReader.cs Defines typed reader operations.
IDeployManifest.cs Defines the deployment-manifest contract.
scripts/VerifyNuGetPackage.ps1 Verifies packaged MSBuild assemblies.
ClickOnceManifestReaderTests.cs Covers reading, adapters, hashing, and serialization.

Review details

Tip

Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 12/12 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@dtivel
dtivel marked this pull request as draft August 11, 2026 15:49
@dtivel
dtivel marked this pull request as ready for review August 12, 2026 00:40
dtivel and others added 3 commits August 11, 2026 17:40
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828
Defer manifest-reader construction to conditional version 2 service registration, which already receives lazy singleton behavior from dependency injection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828
Use the framework-aware ManifestUtilities writer and SHA-256 metadata updates through a shared adapter base. Strengthen the typed filesystem contract and adapter regression coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828
@dtivel
dtivel force-pushed the dtivel/clickonce-manifest-foundation branch from 7429d45 to 287a62b Compare August 12, 2026 00:40
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 13/13 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Comment thread src/Sign.Core/Tools/ClickOnce/ClickOnceManifestReader.cs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828
Comment thread src/Sign.Core/Tools/ClickOnce/ClickOnceManifestReader.cs Outdated
Comment thread src/Sign.Core/Tools/ClickOnce/IApplicationManifest.cs Outdated
dtivel added 2 commits August 12, 2026 14:33
Move shared assembly references and entry-point properties to the common manifest contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be91288d-5106-4c59-a1fa-c5353dccb828
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.

4 participants