C\C++ RESOURCE VERSION RESOURCE VS_VERSION_INFO from resource .rc ==> in c#

Boyd Mills 21 Reputation points
2022-03-02T19:15:57.697+00:00

In c\c++ in the resource editor there is version information that the windows file explorer can see:

==

/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO

FILEVERSION VCI_FILEVERSION
PRODUCTVERSION VCI_PRODUCTVERSION
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L

BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "100904b0"
BEGIN
VALUE "CompanyName", VCI_CORP
VALUE "FileVersion", VCI_FILEVERSIONS
VALUE "LegalCopyright", VCI_LEGALCOPYRIGHT
VALUE "ProductName", VCI_PRODUCTNAME
VALUE "PRODUCTVERSION", VCI_PRODUCTVERSIONS
VALUE "LegalTrademarks", VCI_LEGALTRADEMARKS
// APP SPECIFIC
VALUE "InternalName", VCI_APPNAME
VALUE "FileDescription", VCI_FILEDESCRIPTION
VALUE "OriginalFilename", VCI_ORIGINALFILENAME

    END
END
BLOCK "VarFileInfo"
BEGIN
    VALUE "Translation", 0x1009, 1200
END

END

=

How is this populate in c#?

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
727 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,277 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,159 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Castorix31 81,741 Reputation points
    2022-03-02T21:10:14.873+00:00

    How is this populate in c#?

    I don't understand very well this question (I'm not english but this does not seem clear...)

    If you want to read a file version in C#, you can use FileVersionInfo Class


  2. Karen Payne MVP 35,036 Reputation points
    2022-03-02T22:01:05.287+00:00

    Perhaps a T4 template similar to the following.


  3. RLWA32 40,651 Reputation points
    2022-03-02T22:11:20.317+00:00

    Setting the file version information is dependent on the kind of c# project you're working with. As an example, for a .NET framework project the file version information is set through the project properties and stored in the AssemblyInfo.cs file

    0 comments No comments

  4. Boyd Mills 0 Reputation points
    2022-03-02T22:20:14.007+00:00

    I partly found it.

    179413-image.png

    But I want to change it in one place and have all c# applications built against that one text source.

    0 comments No comments