Skip to content

.NET 8 RC1 can not compile with Windows app sdk and CsWinRT #91981

Closed

Description

@Gaoyifei1011

Description

.NET 8 RC1 can not compile with Windows app sdk and CsWinRT

In.net8 RC1, the Marshal.QueryInterface() method is defined from
public static int QueryInterface (IntPtr pUnk, ref Guid iid, out IntPtr ppv);
Become a
public static int QueryInterface (IntPtr pUnk, in Guid iid, out IntPtr ppv);
Please update the content in WinRT.cs immediately, otherwise the application will not compile

image

Reproduction Steps

In describe bug

Expected behavior

In describe bug

Actual behavior

The Marshal.QueryInterface() method should be compatible with both ref and in arguments

Regression?

No response

Known Workarounds

No response

Configuration

.NET 8 RC1
Windows App SDK 1.4.0
CSWINRT 2.0.3

Other information

None

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Sep 13, 2023
  2. AaronRobinsonMSFT commented on Sep 13, 2023

    @AaronRobinsonMSFT
    Member

    This seems like a breaking change introduced in #89736.

    @tannergooding I don't see any mitigations for the above change. There should have been a breaking change discussion, I wasn't involved so am unclear how to frame this to users.

  3. AaronRobinsonMSFT commented on Sep 13, 2023

    @AaronRobinsonMSFT
    Member

    @Gaoyifei1011 The change to in here was a bit too aggressive. It should be either ref readonly or stay as ref. I will put up a PR shortly.

  4. added this to the 8.0.0 milestone on Sep 13, 2023
  5. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Sep 13, 2023
  6. Gaoyifei1011 commented on Sep 13, 2023

    @Gaoyifei1011
    Author

    @Gaoyifei1011 The change to in here was a bit too aggressive. It should be either ref readonly or stay as ref. I will put up a PR shortly.

    OK.Thanks for the quick fix

  7. hamarb123 commented on Sep 13, 2023

    @hamarb123
    Contributor

    @Gaoyifei1011 could you please see #91983 (comment). Specifically, I'm interested if you have set warnings to errors, and if so you should be able to get VS to generate a #pragma warning disable for you to ignore the warning. Or are you using an outdated version of roslyn / VS preview, which may be causing it to show as an error?

  8. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Sep 13, 2023
  9. ghost locked as resolved and limited conversation to collaborators on Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions