I'm building a mixed-mode assembly with C++/CLI but I can't figure out how to add standard Windows Assembly attributes like Company Name, Copyright, Product Name, Version, etc. There isn't a resource file that works like AssemblyInfo.cs
does in C#. I tried Add->Resource->Version but that just gives me a standard ProjectName.rc
. Anyone knows how to do this?
Asked
Active
Viewed 2,944 times
0

Robin Rodricks
- 110,798
- 141
- 398
- 607
-
What is wrong with the standard rc file??? – Jochen Kalmbach Jan 21 '14 at 12:35
2 Answers
2
It took a while to figure out, and the GUI is buggy so I finally edited it by hand. I've pasted the final contents of my ProjectName.rc
that generates proper Windows Assembly Properties. You can just create an RC file and paste this into it.
If your project is an EXE project, replace FILETYPE 0x2L
with FILETYPE 0x1L
#include <windows.h>
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
///////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Sample Application"
VALUE "CompanyName", "My Company"
VALUE "FileDescription", "My Application"
VALUE "FileVersion", "1, 0, 0, 1"
VALUE "InternalName", "MyProject"
VALUE "LegalCopyright", "Copyright (C) My Company 1999"
VALUE "OriginalFilename", "MyProject.dll"
VALUE "ProductName", "MyProject"
VALUE "ProductVersion", "1, 0, 0, 1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

Robin Rodricks
- 110,798
- 141
- 398
- 607
1
The standard rc-file will give you the standard version info, which can be seen in explorer by right-clicking the file and selecting "Properties".
The assembly infos can be inserted with the assembly attributes:
[assembly:AssemblyTitleAttribute("MCPP_Console")];
[assembly:AssemblyDescriptionAttribute("")];
[assembly:AssemblyConfigurationAttribute("")];
[assembly:AssemblyCompanyAttribute("??")];
[assembly:AssemblyProductAttribute("MCPP_Console")];
[assembly:AssemblyCopyrightAttribute("Copyright (c) ?? 2014")];
[assembly:AssemblyTrademarkAttribute("")];
[assembly:AssemblyCultureAttribute("")];
[assembly:AssemblyVersionAttribute("1.0.0.0")];

Jochen Kalmbach
- 3,549
- 17
- 18
-
Yes, but after adding the std RC file, how do I get the editor like you have shown in the screenshot? – Robin Rodricks Jan 21 '14 at 13:38
-
Do I have to type the code you have shown in the RC file? Is that C++/CLI code or C# code? – Robin Rodricks Jan 21 '14 at 13:39
-
1Just double click the rc file... if you have the express edition, then you might edit the resource file by "hand" in a text editor... – Jochen Kalmbach Jan 21 '14 at 13:40
-
Also see: http://stackoverflow.com/questions/2198935/resource-editor-not-available-in-visual-studio-2008 – Jochen Kalmbach Jan 21 '14 at 13:41
-
If you right-clik on the rc-file and select "Properties", does it display: "Item type: Resopurce compiler"? – Jochen Kalmbach Jan 21 '14 at 14:02