StephenCleary / Comparers

The last comparison library you'll ever need!
MIT License
427 stars 33 forks source link

Strong name #4

Closed fschmied closed 9 years ago

fschmied commented 9 years ago

We'd like to reference the Comparers package from a strong-named application, but we can't because the Comparers.dll is currently an unsigned assembly.

Would it be possible to add a strong name?

StephenCleary commented 9 years ago

It's rather difficult to add strong-naming to this build system. Is there any way you can un-strong-name your application (note that strong-naming provides practically no benefits). Alternatively, you can use the strong-naming toolkit to apply strong names after the fact.

If this won't work, then when I have time I'll address the build system and add this in.

fschmied commented 9 years ago

In this case, strong naming provides one benefit that we need: we're running in a plugin environment (MEF-based) where multiple versions of our assembly (which depends on the Comparers package) might be loaded at the same time. This only works nicely when our DLL is strong-named. (We found out because we didn't SN at first, in which case the first one loaded wins, which is not what we need).

We'll look at alternatives, including the SN toolkit (although at first glance this seems to kill the NuGet/package restore story, doesn't it?), but the easiest solution for us would of course be a strong-named Comparers.dll in the NuGet package. :)

About the build system - would simply checking in the key and referencing it from AssemblyInfo do the trick without much hassle for you? We could prepare a pull request for that.

StephenCleary commented 9 years ago

No, making an existing assembly in a package strong-named is a breaking change. There's just as many good reasons to avoid SN as there are for requiring it.

The proper solution would be to build both the current package as a non-SN, and add a new package as SN.

StephenCleary commented 9 years ago

A strong-named version of Comparers 4.0.0 is now available: https://www.nuget.org/packages/comparers.StrongNamed/4.0.0

fschmied commented 8 years ago

Cool, thanks a lot, we've already started using it!