AssemblyFileVersionAttribute - Non Version Data Possible?
I know this may sound silly, but I'd like to put a version in my FileVersion (since it's not used for referencing, but to indicate what version the file is) that isn't in the standard System.Version
Format of major.minor.build.revision
.
To be frank, 开发者_如何学PythonI'd like to put my repository changeset hash in there, because It accurately represents the version of the file. (I.e the dll generated from the given changeset).
Since the Attribute takes a string input (since Version
isn't constant), will I break anything by doing this?
Would AssemblyInformationVersionAttribute
be better suited for this task? Or is this just flat out going to cause me pain when something assumes it's a MS Formatted Version #?
You are exposing something that's available to anybody. The unmanaged version resource that's generated from the attributes is easily accessible. FileVersionInfo class in .NET. Do note the FileMajor/MinorPart properties, they are integers, not strings. So, yes, the odds that one of those anybody is going to fall over are slim but not zero. [assembly: AssemblyInformationalVersion("blah")] doesn't help, that becomes the "Product version".
That doesn't leave anything but [AssemblyTitle]. A bit bewildering to your users but that's all.
精彩评论