-
Notifications
You must be signed in to change notification settings - Fork 675
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
SelectorBar crashes the app #9424
Comments
@vfib Thanks for reporting. can you please share your project ? |
@ranjeshj Hello, thanks for your answer. I will strip everything sensitive for this. best regards |
@ranjeshj Here it is. |
Same issue. I have a UWP app I'm porting to WinUI 3. I'm trying to update my Pivots to SelectorBars per Microsoft's recommendation, but yeah, crash per @vfib's description. In my XAML I'm changing Pivot to SelectorBar and PivotItem to SelectorBarItem, and updating the SelectionChanged to reflect the new EventArgs. I've also tried placing one in a new UserControl with the same result. |
Same crash here using the same steps as above. Thanks for looking into this. |
@vfib I'm unable to build and run this project even after commenting out SelectorBar and downleveling to WASDK 1.4. I'm also unable to repro the crash by creating a template studio project based on your configurations. Can you provide another repro app? |
Since you dont tell me the errors I cant assist you with this, nor can I provide another project. For me its building fine. |
I'm sorry I can not reproduce this error now cause I've used NavigationView to achieve my goal. I just tried it again and it would not carshed. It's amazing and confusing. By the way, I have to complain about the error report as it dosen't provide any useful thing about the error excepting some useless and meanningless string like " ... microsoft c++ ... winrt:hresult_error ..." |
You can get better debug information if you debug with native code debugging enabled. This produces this error message which does not show when attached only with a managed debugger:
This is the same underlying issue as #8810. This occurs when the project references libraries containing xaml controls (e.g. CommunityToolkit.WinUI.UI.Controls) that were built against an older version of WinAppSDK than the app. This results in an IXamlMetadataProvider being used that includes out of date metadata. See the linked bug for more details. To address this issue we need to fix the bug in the Xaml Compiler that generates the app's IXMP implementation. Until that issue is addressed, there are two ways to work around this bug. The first is to use the DoNotGenerateOtherProviders flag and manually provide the set of IXMP providers. This approach is described in the linked bug. An easier workaround is to add a Xaml page to your app. On that page add an instance of The other way to resolve this issue would be to update the dependencies to newer versions that are built against the target version of WinAppSDK. However updated WCT libraries are not yet available so that is not an option for this case. |
@HHaoWang Turning on all the checkboxes for first-chance exceptions in VS is what got me to produce the above error message. |
Describe the bug
For me, using Win Ui 1.5 with Net 8.0, project created by Template Studio for WinUi C#, simple placing a SelectorBar crashes the whole app.
The exception message is: ""
error code: -2147467259
stack trace:
bei WinRT.ExceptionHelpers.g__Throw|39_0(Int32 hr)
bei WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
bei ABI.Microsoft.UI.Xaml.IFrameworkElementOverridesMethods.MeasureOverride(IObjectReference _obj, Size availableSize)
bei Microsoft.UI.Xaml.FrameworkElement.MeasureOverride(Size availableSize)
bei Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.MeasureOverride(Size availableSize)
bei ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- Ende der Stapelüberwachung vom vorhergehenden Ort ---
bei WinRT.ExceptionHelpers.g__Throw|39_0(Int32 hr)
bei WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
bei ABI.Microsoft.UI.Xaml.IFrameworkElementOverridesMethods.MeasureOverride(IObjectReference _obj, Size availableSize)
bei Microsoft.UI.Xaml.FrameworkElement.MeasureOverride(Size availableSize)
bei Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.MeasureOverride(Size availableSize)
bei ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
Any advice?
Best regards
Steps to reproduce the bug
<SelectorBar x:Name="SelectorBar"> <!--TODO Use x:UID--> <SelectorBarItem x:Name="T1" Text="Item1" /> <SelectorBarItem x:Name="T2" Text="Item2" /> <SelectorBarItem x:Name="T3" Text="Item3" /> </SelectorBar>
Expected behavior
No response
Screenshots
No response
NuGet package version
1.5
Packaging type
Unpackaged
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered: