You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1>D:\returnaggregatorrepro\WinRTAdapter\Generated Files\wv2winrt\HelloComponent.g.cpp(943,37): error C2065: 'returnAggregator': undeclared identifier
1>(compiling source file '/Generated%20Files/wv2winrt/HelloComponent.g.cpp')
1>D:\returnaggregatorrepro\WinRTAdapter\Generated Files\wv2winrt\HelloComponent.g.cpp(939,67): error C2660: 'winrt::impl::consume_HelloComponent_IClassStaticswinrt::HelloComponent::IClassStatics::SayHelloAsync': function does not take 1 arguments
1>(compiling source file '/Generated%20Files/wv2winrt/HelloComponent.g.cpp')
1> D:\returnaggregatorrepro\WinRTAdapter\Generated Files\winrt\impl\HelloComponent.0.h(87,14):
1> see declaration of 'winrt::impl::consume_HelloComponent_IClassStaticswinrt::HelloComponent::IClassStatics::SayHelloAsync'
1> D:\returnaggregatorrepro\WinRTAdapter\Generated Files\wv2winrt\HelloComponent.g.cpp(939,67):
1> while trying to match the argument list '(TOut)'
1> with
1> [
1> TOut=winrt::HelloComponent::SayHelloRequest
1> ]
Looking at the generated code it does seem that for whatever reason returnAggregator is not declared. Peeking at other classes, it does seem to get declared in the preceeding line, i.e.
auto returnAggregator = winrt::make_self<wv2winrt_impl::ReturnAggregator>(
1, !false);
It wasn't apparent where this mismatch comes from, I was only able to replicate with async methods. The workaround would be to use sync method counterparts in the WinRT component, but since there is a compile error already at the binding generation, it's not really a viable alternative.
Importance
Blocking. My app's basic functions are not working due to this issue.
Example minimal repro project at https://github.com/achipa/returnaggregatorrepro, which itself is a clone of the Webview2 sample repo with the addition of the WinRT async component and a configured WinRTAdaptor.
Here is the example 3rd party component IDL of the component that causes wv2winrt to fail:
What happened?
Followed instructions from https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/winrt-from-js?tabs=winui2%2Cwinrtcsharp#custom-3rd-party-winrt-components to create a UWP project that references a WinRT component via WinRTAdapter. For built-in Windows classes, this seems to work fine, as well as sync versions of 3rd party methods. However, in case of async methods (I'm able to repro it consistently that returns IAsyncAction), the generated code does not compile and returns the following error:
1>D:\returnaggregatorrepro\WinRTAdapter\Generated Files\wv2winrt\HelloComponent.g.cpp(943,37): error C2065: 'returnAggregator': undeclared identifier
1>(compiling source file '/Generated%20Files/wv2winrt/HelloComponent.g.cpp')
1>D:\returnaggregatorrepro\WinRTAdapter\Generated Files\wv2winrt\HelloComponent.g.cpp(939,67): error C2660: 'winrt::impl::consume_HelloComponent_IClassStaticswinrt::HelloComponent::IClassStatics::SayHelloAsync': function does not take 1 arguments
1>(compiling source file '/Generated%20Files/wv2winrt/HelloComponent.g.cpp')
1> D:\returnaggregatorrepro\WinRTAdapter\Generated Files\winrt\impl\HelloComponent.0.h(87,14):
1> see declaration of 'winrt::impl::consume_HelloComponent_IClassStaticswinrt::HelloComponent::IClassStatics::SayHelloAsync'
1> D:\returnaggregatorrepro\WinRTAdapter\Generated Files\wv2winrt\HelloComponent.g.cpp(939,67):
1> while trying to match the argument list '(TOut)'
1> with
1> [
1> TOut=winrt::HelloComponent::SayHelloRequest
1> ]
Looking at the generated code it does seem that for whatever reason
returnAggregator
is not declared. Peeking at other classes, it does seem to get declared in the preceeding line, i.e.auto returnAggregator = winrt::make_self<wv2winrt_impl::ReturnAggregator>(
1, !false);
It wasn't apparent where this mismatch comes from, I was only able to replicate with async methods. The workaround would be to use sync method counterparts in the WinRT component, but since there is a compile error already at the binding generation, it's not really a viable alternative.
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
No response
SDK Version
1.0.3124.44
Framework
WinUI2/UWP
Operating System
Windows 11
OS Version
26200.5516
Repro steps
Follow steps from https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/winrt-from-js?tabs=winui2%2Cwinrtcsharp#custom-3rd-party-winrt-components and try to add a component that returns IAsyncAction
Example minimal repro project at https://github.com/achipa/returnaggregatorrepro, which itself is a clone of the Webview2 sample repo with the addition of the WinRT async component and a configured WinRTAdaptor.
Here is the example 3rd party component IDL of the component that causes wv2winrt to fail:
Steps:
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered: