dotnet / dotnet/dotnet-api-docs

FileVersionInfo does not document differences between Windows and other platforms

Open
#11,988 2 comments 0 reactions 0 assignees View on GitHub
area-System.Diagnostics untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

### Type of issue

Missing information

### Description

[On "Unix" platforms FileVersionInfo only looks at managed metadata](https://github.com/dotnet/runtime/blob/9215568cdca8359762089eb2c30f97f74f116b33/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.Unix.cs#L25C1-L34C1), while [on Windows it uses GetFileVersionInfoEx](https://github.com/dotnet/runtime/blob/9215568cdca8359762089eb2c30f97f74f116b33/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.Windows.cs#L21).

The documentation mentions that the "properties are based on version resource information built into the file", and that "Version resources are typically specified in a Win32 resource file, or in assembly attributes." - but it does not mention that the "Unix" platforms only work on managed executables and returns the values found in the managed metadata, unlike Windows which looks at the Win32 resource data.

(This was earlier brought up in [an issue on the runtime repository](https://github.com/dotnet/runtime/issues/40895) which was incorrectly closed after an unrelated fix, but the difference should be documented.)

### Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.fileversioninfo?view=net-8.0

### Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Diagnostics/FileVersionInfo.xml

### Document Version Independent Id

3b2dd44b-4be0-8abc-ad1b-3a4f6f0f751b

### Platform Id

f2cd9136-0015-7b60-80f6-00686ccaf1f3

### Article author

@dotnet-bot

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.