Eastrall / Rosalina

Rosalina is a code generation tool for Unity's UI documents. It generates C# code-behind script based on a UXML template.
MIT License
135 stars 18 forks source link

Errors when adding to project. #11

Closed Randolphjand closed 2 years ago

Randolphjand commented 2 years ago

When I add Roslina to the project with the application that I want to convert to toolkit, I get these errors. It is the same with 2021.2 and in 2022 Assembly 'Packages/com.eastylabs.rosalina/Editor/Roslyn/Microsoft.CodeAnalysis.CSharp.dll' will not be loaded due to errors: Reference has errors 'Microsoft.CodeAnalysis'. Microsoft.CodeAnalysis.Workspaces.dll' will not be loaded due to errors: Microsoft.CodeAnalysis.Workspaces references strong named System.Runtime.CompilerServices.Unsafe Assembly references: 5.0.0.0 Found in project: 4.0.4.1. Assembly Version Validation can be disabled in Player Settings "Assembly Version Validation" Assembly 'Packages/com.eastylabs.rosalina/Editor/Roslyn/Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll' will not be loaded due to errors: Reference has errors 'Microsoft.CodeAnalysis.Workspaces'. Assembly 'Packages/com.eastylabs.rosalina/Editor/Roslyn/Microsoft.CodeAnalysis.VisualBasic.dll' will not be loaded due to errors: Reference has errors 'Microsoft.CodeAnalysis'.

Created new 2021.2.14 project and got errors with nothing installed except Roslina.

Eastrall commented 2 years ago

Thanks for the feedback. I am going to try this on version 2021.2.X. I see that the error specifies:

Assembly Version Validation can be disabled in Player Settings "Assembly Version Validation"

Have you tried to disable that option for testing?

Randolphjand commented 2 years ago

I hope that disabling that does not cause any other issues. I tried it and it worked. Is there a way to keep Roslina from creating a file when I close uxml files that I previously have the code working for in a different way than the new Roslina method?

Randolphjand commented 2 years ago

I updated Unity and now it will not work again.

Eastrall commented 2 years ago

@Randolphjand I just released a new version that removes all roslyn related libraries and replace them with a single one. You shouldn't have errors anymore. Check out the release here: https://github.com/Eastrall/Rosalina/releases/tag/v1.0.2

Let me know if you still have the issue.