views:

621

answers:

1

Is there a way to add assembly attributes to a Managed C++ assembly? IE, specifically in C# in the AssemblyInfo.cs file, you'd typically have something like this:

[assembly: AssemblyTitle("Some Assembly")]

I have a private assembly attribute that I want to add (not one of the version attributes that could be added through a resource file), and am not sure if its possible.

+3  A: 

It is possible - the easy way is to add an AssemblyInfo.cpp file and put:

#include attributes.h //your attribute decl
[assembly: MyCustomAttribute()];

It can be in any file you want, though.

edit - added required semicolon for assembly attribute

Philip Rieck
One very minor thing, this worked, but a semicolon must be added to the end of the statement.
Steve Wranovsky
@Steve W - sorry, fixed.
Philip Rieck