Build failures if Windows versions between C++ Component and .NET don't match
Open
@angelazhangmsft is already working on this.
Since Apr 5, 2021.
bug
pri-2
- Dominant language
- C#
- Stars
- 665
- Forks
- 134
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 32
Description
See this repro:
CsWinRTRepro.zip
The C++ component is built with a target version of 19041, and the .net5 project is targeting 18362.
The error you get is:
error CS0234: The type or namespace name 'AttributeNameAttribute' does not exist in the namespace 'Windows.Foundation.Metadata' (are you missing an assembly reference?)
error CS0234: The type or namespace name 'AttributeName' does not exist in the namespace 'Windows.Foundation.Metadata' (are you missing an assembly reference?)
This is because the AttributeNameAttribute type was added in 19041. Oddly, the same idl builds if targeting 18362, it's just that the AttributeNameAttribute isn't encoded in the metadata (presumably, I didn't look)
Related to #507
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.