setting product version

83 views
Skip to first unread message

Simon

unread,
Oct 13, 2012, 8:48:20 PM10/13/12
to mono-...@googlegroups.com
So when I set AssemblyInformationalVersionAttribute in code (as part of a compile) it appears in the files "Product version" when viewing properties in windows explorer.

However when set this attribute post compile with Cecil it does not show up in "Product version"

code is basically this 


        var customAttributes = ModuleDefinition.Assembly.CustomAttributes;
        var versionAttribute = GetVersionAttribute();
        var constructor = ModuleDefinition.Import(versionAttribute.Methods.First(x => x.IsConstructor));
        var customAttribute = new CustomAttribute(constructor);
        customAttribute.ConstructorArguments.Add(new CustomAttributeArgument(ModuleDefinition.TypeSystem.String, "Foo"));
        customAttributes.Add(customAttribute);

Obviously I am doing something wrong... any ideas?

Jb Evain

unread,
Oct 14, 2012, 4:50:25 AM10/14/12
to mono-...@googlegroups.com
Hey Simon,

Those attributes are compiled as part of the .rsrc section.
They're basically special Win32 resources.

This is bug https://github.com/jbevain/cecil/issues/3

Jb
> --
> --
> mono-cecil

Simon

unread,
Oct 14, 2012, 6:29:16 AM10/14/12
to mono-...@googlegroups.com

Simon

unread,
Oct 14, 2012, 6:34:25 AM10/14/12
to mono-...@googlegroups.com
any chance of pulling resource support from one of those forks?

Jb Evain

unread,
Oct 14, 2012, 6:53:19 AM10/14/12
to mono-...@googlegroups.com
I have this as well from Cecil 0.6.

The issue is providing a good API on top of resource parsing.
> --
> --
> mono-cecil

Simon

unread,
Oct 14, 2012, 6:58:41 AM10/14/12
to mono-...@googlegroups.com
since it is an edge use I would think any API would do. perhaps dont worry about making it "good"?
Reply all
Reply to author
Forward
0 new messages