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

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

Open
negue opened this issue Oct 19, 2021 · 1 comment
Open

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

negue opened this issue Oct 19, 2021 · 1 comment

Comments

@negue
Copy link

negue commented Oct 19, 2021

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"

@negue
Copy link
Author

negue commented Oct 27, 2021

I tried moving Delight to the Library Directory, like described in #28. I hoped that this would decouple some things so that the editor doesn't to reload everything, but it seems that doesn't work for this Package at all. (Designer not working then anymore).

I tried disabling the auto-compile of Unity but it seems that "crash" of the following log is repeated endless:

Compilation is still ongoing. Will not reload assemblies.
Reloading assemblies after forced synchronous recompile.

On Unity 2021.1.25f1 it doesn't have the "Reload Script Assemblies" endless loop of ^ but it still stops at

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

and then need to kill Unity inorder to work again.


I can't seem to find the reason why its only happening when you edit something from inside the Unity Delight Designer that use Embedded C# Code.

If you change the XML outside and press "Rebuild All" on the Delight-Panel - there is no issue.

Could it be that the process after exiting the running Unity "game" still has some weird Assembly References that prevents everything to replace it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant