NickStrupat / NameOf

Provides strongly typed access to a compile-time string representing the name of a variable, field, property, method, event, enum, or type.
MIT License
20 stars 7 forks source link

Provide key to strongly sign the assembly #3

Closed MovGP0 closed 9 years ago

MovGP0 commented 9 years ago

In order to avoid compiler errors in strongly signed assemblies, the NameOf.Fody project should be signed with an .pfx key:

https://msdn.microsoft.com/en-us/magazine/cc163583.aspx

NickStrupat commented 9 years ago

I'm willing to "strong-name" Name.Of.dll with an .snk file, is that all that's needed for your case?

MovGP0 commented 9 years ago

I am not sure if that works for libraries that ship with a public distributed application. :-/

Let's try it with the .snk file first...

NickStrupat commented 9 years ago

Name.Of.dll shouldn't be distributed because after a successful weaving, all references to it have been replaced with string literals. It just needs to be OK during compile, but after the compile and weaving it is removed and Name.Of.dll doesn't get put in the build output directory (at least it shouldn't)

NickStrupat commented 9 years ago

I'm signing Name.Of.dll in the latest version and NuGet package 0.8.2 with a .snk file. Could you check if that is allowing you to build?

NickStrupat commented 9 years ago

Is your issue resolved? Can I close this?

MovGP0 commented 9 years ago

I still got the error:

Error   2125    Assembly '..\packages\NameOf.Fody.0.8.3\lib\Name.Of.dll' must be strong signed in order to be marked as a prerequisite.

The problem seems to have to do with the Click-Once publishing settings.

Solution (Visual Studio):