View Issue Details

IDProjectCategoryView StatusLast Update
0002201NoesisGUIC++ SDKpublic2021-12-15 19:53
Reporterasusralis Assigned Tosfernandez  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.1.1 
Target Version3.1.2Fixed in Version3.1.2 
Summary0002201: Crash when applying style to custom control.
DescriptionUnity will crash once the editor imports everything - it doesn't need to use the control in-game. Removing ApplyTemplate() will avoid crashes after importing but will crash when showing the control (I'm pretty sure at least...?). I'm kind of getting random crashes everywhere while using this control.
Steps To Reproduce    public class ExpeditionMap : Control
    {
        public ExpeditionMap()
        {
            Loaded += (s, e) =>
            {
                ApplyTemplate();
            };

            DataContextChanged += (s, e) =>
            {
                
            };
        }

        static ExpeditionMap()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(ExpeditionMap), new FrameworkPropertyMetadata(typeof(ExpeditionMap)));
        }
    }

    <Style TargetType="local:ExpeditionMap">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ExpeditionMap">
                    <Grid>
                        <TextBlock Text="Hello!" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
TagsNo tags attached.
PlatformAny

Activities

asusralis

asusralis

2021-11-28 09:43

reporter  

sfernandez

sfernandez

2021-12-15 18:05

manager   ~0007676

Hi, I see in the log the following error message while trying to run the static constructor for Shelter.Views.ExpeditionMap.:

[NOESIS/E] DependencyProperty 'NodeStyle' already registered to type 'Shelter.Views.LocationView'


Can you verify that the call to DependencyProperty.Register() has all the parameters fine? It seems that you are using typeof(LocationView) as owner instead of typeof(ExpeditionMap).

Anyway, I'll check our code to see why it is crashing when trying to register a duplicate property.
sfernandez

sfernandez

2021-12-15 19:53

manager   ~0007677

I was able to reproduce the crash by defining 2 dependency properties with the same string name.
It will be fixed for the next release.

Issue History

Date Modified Username Field Change
2021-11-28 09:43 asusralis New Issue
2021-11-28 09:43 asusralis File Added: Crash_2021-11-28_083712163.7z
2021-11-28 10:21 asusralis Description Updated
2021-11-28 10:21 asusralis Steps to Reproduce Updated
2021-11-28 10:24 asusralis Description Updated
2021-11-29 10:30 sfernandez Assigned To => sfernandez
2021-11-29 10:30 sfernandez Status new => assigned
2021-11-29 10:30 sfernandez Target Version => 3.1.2
2021-12-15 18:05 sfernandez Status assigned => feedback
2021-12-15 18:05 sfernandez Note Added: 0007676
2021-12-15 19:53 sfernandez Status feedback => resolved
2021-12-15 19:53 sfernandez Resolution open => fixed
2021-12-15 19:53 sfernandez Fixed in Version => 3.1.2
2021-12-15 19:53 sfernandez Note Added: 0007677