question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Condense properties required for strong-name signing

See original GitHub issue

In order to get strong-name signing to work, a project must have these three properties:

<PropertyGroup>
    <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Key.snk</AssemblyOriginatorKeyFile>
    <SignAssembly>true</SignAssembly>
    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
</PropertyGroup>

preview2 supported strong-name signing by setting just one property: “keyFile” in project.json. It would be nice to condense this to one:

<PropertyGroup>
    <KeyFile>$(MSBuildThisFileDirectory)Key.snk</KeyFile>
</PropertyGroup>

cc @davidfowl

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
natemcmastercommented, Jun 21, 2017

To be clear, the request here was not to change existing behavior of AssemblyOriginatorKeyFile, SignAssembly, or PublicSign. The request was to add a new property (such as StrongNameKeyFile) and infer the other properties from it as necessary to make signing happen. This is a PJ parity request.

It seems this would be as simple as adding this to the SDK:

<PropertyGroup Condition="'$(StrongNameKeyFile)' != ''">
    <AssemblyOriginatorKeyFile>$(StrongNameKeyFile)</AssemblyOriginatorKeyFile>
    <SignAssembly>true</SignAssembly>
    <PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
</PropertyGroup>
0reactions
nguerreracommented, Jun 21, 2017

We could consider that without the public sign part (I’m not budging on that, it’s a hack – push on Roslyn, not SDK, to get rid of it), but then it would fight with the property page and open questions as to which property wins. I don’t think there’s enough value to offset that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to: Sign an assembly with a strong name | ...
In Solution Explorer, open the shortcut menu for the project, and then choose Properties. Under the Build tab you'll find a Strong naming...
Read more >
Three ways to tell if a .NET Assembly (DLL) has Strong Name
Your first step is to load the desired Assembly using the ... Strong Names and Digital Signatures are Orthogonal Concerns – Almost.
Read more >
Digitally signing a strong named .NET assembly
If you use the signing attributes when building in the development environment, you can successfully sign the assembly by explicitly calling sn.
Read more >
Giving a .NET Assembly a Strong Name
You assign an assembly a strong name by associating the assembly with a pair of 1024-bit cryptographic public and private keys.
Read more >
Adding a Strong Name to a Third-Party Assembly - Chris Memo
You'll need to add a strong name yourself. ... a key pair via the AssemblyKeyFile attribute, or via the Signing tab of Project...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found