Leverage AssemblyMetadata attribute for nuspec token replacements


Currently there are a fixed number of attributes that are taken from a project's AssemblyInfo to be used as replacement tokens in a nuspec file when generating a package for a project.

Additional replacement values must be specified via the nuget command line only, in order to be usable as replacement tokens.

AssemblyMetadataAttribute (see http://msdn.microsoft.com/en-us/library/system.reflection.assemblymetadataattribute(v=vs.110).aspx) could be used to automatically extend the replacement tokens in a very convenient way.

This would allow easy replacement of an $authors$ or $owners$ tokens in the .nuspec by simply having the following in a common assemblyinfo.cs:

[assembly: AssemblyMetadata("authors", "foo, bar")]
[assembly: AssemblyMetadata("owners", "Outercurve")]

Pull Request right here: https://nuget.codeplex.com/SourceControl/network/forks/dcazzulino/nuget/contribution/7268


dcazzulino wrote Aug 12, 2014 at 5:58 PM

Fixed url

dcazzulino wrote Sep 2, 2014 at 5:02 PM

Updated with PR link

juste wrote Sep 11, 2014 at 6:49 PM

Merged into master 0b1836110e8e9418db8ddae6e1773623f9241cd5