Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Gaoyifei1011 opened this issue Sep 13, 2023 · 5 comments · Fixed by #91983
Closed

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

Gaoyifei1011 opened this issue Sep 13, 2023 · 5 comments · Fixed by #91983

Comments

@Gaoyifei1011
Copy link

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

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Sep 13, 2023
@ghost
Copy link

ghost commented Sep 13, 2023

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Issue Details

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

Author: Gaoyifei1011
Assignees: -
Labels:

area-System.Runtime.InteropServices

Milestone: -

@AaronRobinsonMSFT
Copy link
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.

@AaronRobinsonMSFT
Copy link
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.

@AaronRobinsonMSFT AaronRobinsonMSFT removed the untriaged New issue has not been triaged by the area owner label Sep 13, 2023
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 8.0.0 milestone Sep 13, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Sep 13, 2023
@Gaoyifei1011
Copy link
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

@hamarb123
Copy link
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?

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Sep 13, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants