microsoft / microsoft/CsWinRT

Bug: Can't bind to ImmutableArray when using Native AOT

Open
#2,507 0 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

If you try to initialize the array with collection expression you get an unhandled win32 exception. If you try with a Builder, you get an ArgumentException and a an additional message saying "WinRT information: Argument 'source' is not a supported vector."

Repro repo

Steps To Reproduce

Set PublishAot to true, create an ImmutableArray and bind it.

Expected Behavior

To work.

Version Info

CsWinRT 2.1.3
.NET SDK 10.0.302
Windows SDK 26100.8249

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 with the linked IArrayRepro repository and reproduce the collection-expression and Builder cases with PublishAot set to true. Investigate the binding path for ImmutableArray under CsWinRT 2.1.3; done means both initialization approaches bind without the unhandled Win32 exception or the unsupported-vector ArgumentException.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.