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

HorizontalStackLayout Crashes Debugger on Negative Spacing #19513

Open
JonesWebConsulting opened this issue Dec 20, 2023 · 4 comments · May be fixed by #26927
Open

HorizontalStackLayout Crashes Debugger on Negative Spacing #19513

JonesWebConsulting opened this issue Dec 20, 2023 · 4 comments · May be fixed by #26927
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter layout-stack platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@JonesWebConsulting
Copy link

JonesWebConsulting commented Dec 20, 2023

Description

This article states that negative spacing is allowed on the HorizontalStackLayout control, however, many times this will (randomly) crash Visual Studio's debugger.

Here is my code:

<?xml version="1.0" encoding="utf-8" ?> 
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"              
	x:Class="GinRummyMAUI.MainPage">
<StackLayout>          
	<HorizontalStackLayout
		x:Name="humanCardLayout"             
		HorizontalOptions="CenterAndExpand"             
		Spacing="-5">              
	
	<Image                 
		x:Name="Card1"                  
		Source="back_purple.png"/>              

	<Image                 
		x:Name="Card2"                  
		Source="back_purple.png"/>           

	</HorizontalStackLayout>      
</StackLayout>  
</ContentPage>
  • Having just one image control the code works fine.
  • Adding the second image control (or more than 2) causes Visual Studio to crash.
  • When running without debugging, the MAUI application crashes to the desktop and shows a fatal exception in XAML DLL.

Faulting application name: GinRummyMAUI.exe, version: 1.0.0.0, time stamp: 0x65410000
Faulting module name: Microsoft.ui.xaml.dll, version: 3.1.3.0, time stamp: 0xea4b25b7
Exception code: 0xc000027b
Fault offset: 0x00000000007dc2aa
Faulting process id: 0x0x4224
Faulting application start time: 0x0x1DA3288F559DEEC
Faulting application path: C:\Users\syste\OneDrive\Desktop\Development\GinRummy\GinRummyMAUI\bin\Debug\net8.0-windows10.0.19041.0\win10-x64\AppX\GinRummyMAUI.exe
Faulting module path: C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.3_3000.934.1904.0_x64__8wekyb3d8bbwe\Microsoft.ui.xaml.dll
Report Id: e84bb758-64ad-49bb-be52-99b0debad0b2
Faulting package full name: com.companyname.ginrummymaui_1.0.0.1_x64__9zz4h110yvjzm
Faulting package-relative application ID: App

Issue was also confirmed on this post.

ss

Steps to Reproduce

  1. Create a MAUI application
  2. Add the code above to the main page.

Link to public reproduction project repository

https://github.com/JonesWebConsulting/HorizontalStackLayout_MS_Issue_19513.git

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

I was not able test on other platforms

Affected platform versions

Windows 11 Home 22H2

Did you find any workaround?

Removing the negative value from spacing fixes the issue, but then does not provide the desired spacing.

Relevant log output

GinRummyMAUI.dll!GinRummyMAUI.WinUI.App.InitializeComponent.AnonymousMethod__3_1(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e) Line 68 C#
@JonesWebConsulting JonesWebConsulting added the t/bug Something isn't working label Dec 20, 2023
@jsuarezruiz jsuarezruiz added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter layout-stack platform/windows 🪟 labels Dec 20, 2023
@PureWeen PureWeen added the s/needs-repro Attach a solution or code which reproduces the issue label Dec 20, 2023
@ghost
Copy link

ghost commented Dec 20, 2023

Hi @JonesWebConsulting. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@JonesWebConsulting
Copy link
Author

Repo has been added.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Dec 21, 2023
@PureWeen PureWeen removed the s/needs-attention Issue has more information and needs another look label Dec 21, 2023
@PureWeen PureWeen added this to the Backlog milestone Dec 21, 2023
@ghost
Copy link

ghost commented Dec 21, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jan 18, 2024
@XamlTest
Copy link

Verified this on Visual Studio Enterprise 17.9.0 Preview 2(8.0.3). Repro on Windows 11, not repro on Android 14.0-API34, iOS 17.0 and MacCatalyst with below Project:
HorizontalStackLayout_19513.zip

@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 3, 2024
@samhouts samhouts added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter layout-stack platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants