dotnet / dotnet/msbuild

Inconsistency between (SignAssembly vs DelaySign) and (SignAssembly vs PublicSign)

Open
#1,489 3 comments 0 reactions 0 assignees View on GitHub
bug Future Release Bar-check triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

### Repro steps
* File -> New Project -> Console Application (.NET Framework)

* Properties -> Signature:
* check sign assembly
* add new snk (w/o password)
* check delay signing option
* uncheck sign assembly

* Build
* Notice that is succeeds but does not sign (because SignAssembly is false)

* Edit project file ->change `true` to `true`

* Build again

### Expected result
Just as in delay sign case, no signing is performed because SignAssembly is false

### Actual result
```
Erreur CS8102 La signature publique a été spécifiée et nécessite une clé publique. Toutefois, aucune clé publique n'a été spécifiée`
```
Translation: "Public signature was specified and requires a public key. However, no public key was specified."

This is confusing because I have actually specified a public key. Moreover, I've unchecked sign assembly so it should not be attempting to sign.

### Root cause

See https://github.com/Microsoft/msbuild/blob/052ad30f8f706a87e9fa9431fda1ec9c0b73893b/src/XMakeTasks/Microsoft.Common.CurrentVersion.targets#L507

DelaySign is forced to false when SignAssembly is not true, but PublicSign does not get the same treatment.

@agocke @jaredpar @cdmihai

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.