I am working with a C++/CLI Project that wraps a C++ Native Library in Visual Studio 2012.
My C++/CLI Project has an AssemblyInfo.cpp. I set all the fields there, which include an "AssemblyVersionAttribute". However when I built my project and check its properties in the Windows Explorer, the version information is empty.
This is my first C++/CLI project, I have been going over all the options in the project properties but I couldn't find any that works for setting the version.
How do you set the version for a C++/CLI Project?
Update
I will add the content of my AssemblyInfo.cpp. I just filled in the fields that were present, this was automatically generated when I created the project.
using namespace System; using namespace System::Reflection; using namespace System::Runtime::CompilerServices; using namespace System::Runtime::InteropServices; using namespace System::Security::Permissions; [assembly:AssemblyTitleAttribute("MyTitle")]; [assembly:AssemblyDescriptionAttribute("")]; [assembly:AssemblyConfigurationAttribute("")]; [assembly:AssemblyCompanyAttribute("")]; [assembly:AssemblyProductAttribute("MyProduct")]; [assembly:AssemblyCopyrightAttribute("Copyright © 2014")]; [assembly:AssemblyTrademarkAttribute("Inc")]; [assembly:AssemblyCultureAttribute("")]; [assembly:AssemblyVersionAttribute("3.9.0")]; [assembly:ComVisible(false)]; [assembly:CLSCompliantAttribute(true)]; [assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
To set this compiler option in the Visual Studio development environment. Open the project's Property Pages dialog box. For more information, see Set C++ compiler and build properties in Visual Studio. Select the Configuration Properties > C/C++ > Language property page.
In Visual Studio You can set compiler options for each project in its Visual Studio Property Pages dialog box. In the left pane, select Configuration Properties, C/C++ and then choose the compiler option category.
Before you start, you should add the -Bv compiler option as an Additional Option on the compiler command line. This will show the verbose compiler version information in the build Output box. Just enter “-Bv” in the Project Properties > C/C++ > Command Line edit box.
The 'Details' page in Windows Explorer is pulling the information from unmanaged structures in the file, so you'll need to create an unmanaged version resource in order to fill that in.
I recommend that you maintain the various assembly attributes in your AssemblyInfo.cpp file as well. If you use reflection to get information about the assembly, it will use the stuff in AssemblyInfo.cpp, not in the version resource.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With