How do you set the version of a C++/CLI project in Visual Studio?

吃可爱长大的小学妹 提交于 2019-12-01 02:30:24

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.

  1. In Visual Studio, add a "Resource File (.rc)" to your project, if you don't already have one.
  2. In the resource file, add a new "Version" resource.
  3. Fill in your information.

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.

Andy Hopper

There are two attributes; an AssemblyVersion attribute and an AssemblyFileVersion attribute. With the C# compiler, the file version will track the AssemblyVersion if an AssemblyFileVersion is not supplied. I can't recall if the C++/CLI compiler behaves differently, but it certainly is worth a shot to try AssemblyFileVersion.

Maurice

You can modify the VS_VERSION_INFO file inside the folder \app.rc\Version. You may use the Resource Visualizzation IDE to display this information file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!