7

Closed

Don't add a Strong Name to the Silverlight/Windows Phone assemblies

description

I can't think on any reason to add SNK signing (e.g. add a Strong Name) to Silverlight (including Windows Phone) output assemblies!
 
This gives a lot of versioning problems to other library developers who use Json.net, as you can see here on RestSharp:
https://github.com/restsharp/RestSharp/issues/187#issuecomment-3303657
 
Adding Strong Names is great ifwe want to add the assemblies to GAC, but that for full .NET Framework only, not for Silverlight or Windows Phone!
 
In the full .NET we can always use Assembly Redirection or Publisher Policies to bypass this issue, but once again, this can't be achieved in Silverlight or Windows Phone!
 
So PLEASE don't add a strong name to silverlight and windows phone output assemblies!!!!
 
Thank you and best regards,
 
Pedro Lamas
Closed Feb 10, 2012 at 12:02 PM by JamesNK
Done

comments

dkarzon wrote Dec 30, 2011 at 12:09 AM

I argree as I am also seeing this with my library https://github.com/dkarzon/DropNet/issues/40

JamesNK wrote Dec 30, 2011 at 2:57 AM

If I remove the strong name then any SL/WP applications and libraries that are strong named will break and people will ask it to go back again. I'm not sure there is one approach that works for everyone.

If you guys are using NuGet then what about explicitly specifying the version of Json.NET to use?

PedroLamas wrote Dec 30, 2011 at 11:34 AM

I realize what you say is true James, though right now you have some libs already with this issue (RestSharp you see above, and my own Cimbalino Toolkit), thus my request!

Truth be told, if you remove the SNK from silverlight output assemblies only, you may get people complaining once about that, but once they too remove their SNK from their SL libs, no more problems will arrise!

Specifing the Json.net version on a particular NuGet will not work because one can use RestSharp and Cimbalino Toolkit (or any other two or more libs) and they can specify different versions of Json.net.
This is the case right now: RestSharp is buit upon 4.0.3 and Cimbalino Toolkit on 4.0.4

PedroLamas wrote Jan 2, 2012 at 12:41 PM

Apparently, RavenDB also uses Json.net and has the same issues:
https://github.com/ravendb/ravendb/pull/396

They solved it by setting the specific version of Json.net on the NuGet spec (4.0.5), and this is ok for me, until I use it with RestSharp, that uses a previous version (4.0.3) right now...

So, the solution of specifying the version on the NuGet comes with another question:
  • How can we use two versions of the same assembly in Silverlight/Windows Phone?
My guess, we can't... but if the public methods signatures match AND the assemblies aren't strongly signed, it will use whatever assembly is available, regardless of the version!

nberardi wrote Feb 10, 2012 at 1:31 PM

Can we just not sign assemblies that are pushed to NuGet? Because assembly redirection while useful is not obvious to most developers.