microsoft / microsoft/CsWinRT

Bug: args.Cue in NativeAOT-build has IInspectable type

Open
#2,024 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
665
Forks
134
Avg merge
1d 3h
Merged PRs (30d)
32

Description

Description

When custom handling subtitles in MediaPlaybackItem in UWP on .NET 9, the argument type changes to WinRT.IInspectable in NativeAOT build.

This code in Debug build outputs ImageCue (in the case of my video file, which is correct), and when built in NativeAOT it starts outputting IInspectable.

private void CurrentSubtitle_CueEntered(TimedMetadataTrack sender, MediaCueEventArgs args)
{
    RunOnUIThread(() =>
    {
        DebugText.Text = args.Cue.GetType().Name;
    });
}
Steps To Reproduce
  1. Create MediaPlaybackItem object with videofile with subtitles
  2. Select TimedTextTrack from embedded subtitles
  3. Subscribe to its CueEntered event
  4. Output somewhere type of args.Cue in CueEntered event handler
Expected Behavior

args.Cue has the same type in NativeAOT build as in debug-build.

Version Info

.NET: 9.0.7
CsWinRT: 2.2.0
Windows SDK: 10.0.26100

Additional Context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the MediaPlaybackItem subtitle CueEntered scenario described in the issue under both Debug and NativeAOT builds, using the reported .NET, CsWinRT, and Windows SDK versions. Trace the projected MediaCue handling and compare args.Cue types; done means NativeAOT reports the same cue type as the Debug build.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.