Skip to content

Add assembly strong name. - #82

Merged
tmds merged 2 commits into
tmds:masterfrom
mfilippov:strong-name
Aug 28, 2020
Merged

Add assembly strong name.#82
tmds merged 2 commits into
tmds:masterfrom
mfilippov:strong-name

Conversation

@mfilippov

@mfilippov mfilippov commented Jul 17, 2020

Copy link
Copy Markdown
Contributor

Add strong name to allow use this library in projects with strong names.

@mfilippov
mfilippov force-pushed the strong-name branch 7 times, most recently from fa5a1ca to e98894e Compare July 17, 2020 21:48
@mfilippov

Copy link
Copy Markdown
Contributor Author

@tmds ping.

@tmds

tmds commented Aug 26, 2020

Copy link
Copy Markdown
Owner

I will make some time for this tomorrow.

@mfilippov

Copy link
Copy Markdown
Contributor Author

@tmds Thank you!

Comment thread src/Tmds.DBus/CodeGen/DynamicAssembly.cs Outdated
_moduleBuilder = _assemblyBuilder.DefineDynamicModule(Tmds.DBus.Connection.DynamicAssemblyName);
var keyStream = typeof(DynamicAssembly).GetTypeInfo().Assembly.GetManifestResourceStream("Tmds.DBus.sign.snk");
if (keyStream == null) throw new InvalidOperationException("'Tmds.DBus.sign.snk' not found in resources");
var keyBuffer = new byte[keyStream.Length];

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Should we hard-code these bytes in order to not have to pack Tmds.DBus.sign.snk?
Is this the same data as the hex-encoded PublicKey in DynamicAssemblyName?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is possible but looks a little strange. snk in resources add a similar amount of bytes.

@tmds

tmds commented Aug 27, 2020

Copy link
Copy Markdown
Owner

@mfilippov Thanks for adding this. haven't used strong naming in real life. I'm curious to learn a bit more. I guess you need this because you want to strong name your own assembly? Do you have a strong reason to strong name your assembly? Or is is also a requirement that ripples down on you?

You're signing 3 things: Tmds.DBus, Tmds.DBus.Tool, and the dynamic assembly: Tmds.DBus.Emit. Do you need all 3 to be strongly named?

PR looks good, just a few nits.

@mfilippov

Copy link
Copy Markdown
Contributor Author

@tmds Without strong name assembly could not be identified by version. And if you have a strong name on the entry point, you can't load assembly without a strong name. We want to use Avalonia in our project, which has a strong-named entry point.

@tmds
tmds merged commit 8c768c9 into tmds:master Aug 28, 2020
@mfilippov
mfilippov deleted the strong-name branch August 28, 2020 14:35
@mfilippov

Copy link
Copy Markdown
Contributor Author

@tmds Thank you! Could you publish a new version on nuget.org?

@tmds

tmds commented Aug 28, 2020

Copy link
Copy Markdown
Owner

Thanks @mfilippov! I'll release a new version of Tmds.DBus by next week.

@tmds

tmds commented Sep 9, 2020

Copy link
Copy Markdown
Owner

@mfilippov it took a week longer, but available now in 0.9.0 on nuget.org.

@mfilippov

Copy link
Copy Markdown
Contributor Author

@tmds Great thank you!

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