Skip to content

Unity hangs after saving a View with embedded C#  #42

Description

@negue

This Issue took some time to understand and to find cause each try the process stopped working 😁

System: Win10 - 20H2
Unity: 2020.3.17f1
Delight: current store version

When using this example view

<NewView AdjustToParent="Stretch" MyBool="t:Boolean" 
                         BasedOn="LayoutRoot">
 <Grid AdjustToParent="Stretch"> 
<Group Spacing="10" Alignment="BottomLeft"
         BackgroundColor="Green" Orientation="Horizontal">

  <Group Spacing="10" Alignment="TopLeft" 
         IsVisible="$ {MyBool} != false " >
  <Group Orientation="Horizontal">
    <Label Text="Test: {MyBool}" /> 
  </Group>
  
</Group>

</Group>

   </Grid>

</NewView>

This or other embedded C# Codes seems to break the process of creating the script files:
IsVisible="$ {MyBool} != false "

Reproduce:

  1. Be in the designer, change anything in the view file

  2. Save and stop the running "game"

  3. You'll see something like this in the Console Log:

    Copying assembly from 'Temp/Assembly-CSharp.dll' to 'Library/ScriptAssemblies/Assembly-CSharp.dll' failed. Detailed error: Sharing violation on path

  4. Unfocus Unity, and refocus it

  5. due to the issue in 3. - unity never comes back from
    image

Nothing happens when you don't have the embedded C# code then it all "just works"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions