microsoft / microsoft/CsWinRT

Build failures if Windows versions between C++ Component and .NET don't match

Open
#508 2 comments 0 reactions 2 assignees View on GitHub

@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

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.