Skip to content

[Bug]: Core version of RAR fails to read WinRT runtime version from assemblies #8731

Closed

Description

@ladipro

Issue Description

The non-Framework / non-Windows implementation of RAR has a bug where it incorrectly assumes that the metadata version - referred to as "runtime version" in the code - has to start with 'v'. Metadata version of WinRT files looks like WindowsRuntime 1.4 or WindowsRuntime 1.4;CLR v4.0.30319.

Steps to Reproduce

Create a WinRT component using the Windows Runtime Component template in VS and add it as a reference to a .NET project. Build the project.

Expected Behavior

image

Actual Behavior

image

Analysis

Here's the bug:

// Read the version string
var v = Encoding.UTF8.GetString(sr.ReadBytes(length));
if (v.Length < 2 || v[0] != 'v')
{
return string.Empty;
}

It's not clear what the downstream effect is. Since .winmd's cannot be referenced by modern .NET projects anyway - the build errors out in the CheckForUnsupportedWinMDReferences task - it is possible that this part of Core RAR may be deleted.

Versions & Configurations

MSBuild version 17.6.0-preview-23174-01+e7de13307 for .NET

Activity

  1. removed
    needs-triageHave yet to determine what bucket this goes in.
    on May 9, 2023
  2. self-assigned this
    on May 11, 2023
  3. added a commit that references this issue on May 18, 2023
    d94a109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions