Closed igor-100 closed 1 year ago
What exactly does not work?
I have no experience with Unity so far, so either you can supply a PR which adds support or you can let me know what needs to be done. If it is not too much effort, I will consider maintaining it.
There are errors when I try to import the project. It seems that Unity's backend (Mono) version has a bit outdated .NET libraries. I'll try to fix it on my own later, I just hoped that you might know the solution.
Starting: C:\Program Files\Unity 2021.3.1f1\Editor\Data\bee_backend.exe --profile="Library/Bee/backend_profiler0.traceevents" --stdin-canary --dagfile="Library/Bee/1900b0aEDbg.dag" --continue-on-failure ScriptAssemblies
WorkingDir: ~
ExitCode: 0 Duration: 0s908ms
[725/730 0s] Csc Library/Bee/artifacts/1900b0aEDbg.dag/Assembly-CSharp.dll (+2 others)
warning CS8032: An instance of analyzer Lombok.NET.PropertyGenerators.NotifyPropertyChangedGenerator cannot be created from ~Assets\Packages\Lombok.NET.2.1.0\analyzers\dotnet\cs\Lombok.NET.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified..
...
Reloading assemblies after forced synchronous recompile.
Begin MonoManager ReloadAssembly
Symbol file LoadedFromMemory doesn't match image ~Library\PackageCache\com.unity.visualscripting@1.7.6\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory doesn't match image ~Library\PackageCache\com.unity.visualscripting@1.7.6\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll
Assembly 'Assets/Packages/System.Reflection.Metadata.5.0.0/lib/netstandard2.0/System.Reflection.Metadata.dll' will not be loaded due to errors:
System.Reflection.Metadata references strong named System.Collections.Immutable Assembly references: 5.0.0.0 Found in project: 6.0.0.0.
Assembly Version Validation can be disabled in Player Settings "Assembly Version Validation"
Assembly 'Assets/Packages/Microsoft.CodeAnalysis.Common.4.3.1/lib/netstandard2.0/Microsoft.CodeAnalysis.dll' will not be loaded due to errors:
Reference has errors 'System.Reflection.Metadata'.
Assembly 'Assets/Packages/Microsoft.CodeAnalysis.CSharp.4.3.1/lib/netstandard2.0/Microsoft.CodeAnalysis.CSharp.dll' will not be loaded due to errors:
Reference has errors 'Microsoft.CodeAnalysis'.
Assembly 'Assets/Packages/Microsoft.CodeAnalysis.Workspaces.Common.4.3.1/lib/netstandard2.0/Microsoft.CodeAnalysis.Workspaces.dll' will not be loaded due to errors:
Unable to resolve reference 'SQLitePCLRaw.core'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Unable to resolve reference 'SQLitePCLRaw.batteries_v2'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
Assembly 'Assets/Packages/Microsoft.CodeAnalysis.CSharp.Workspaces.4.3.1/lib/netstandard2.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll' will not be loaded due to errors:
Reference has errors 'Microsoft.CodeAnalysis.Workspaces'.
Assembly 'Assets/Packages/Lombok.NET.2.1.0/lib/netstandard2.0/Lombok.NET.dll' will not be loaded due to errors:
Reference has errors 'Microsoft.CodeAnalysis.CSharp'.
Native extension for WindowsStandalone target not found
What .NET and VS version (or Rider) are you using? If it's VS, it needs to be at least v17.3.
I'm using NuGetForUnity https://github.com/GlitchEnzo/NuGetForUnity, it seems to depend on Unity only. It's not a VS or Rider extension.
And I can see that you're using C# 10.0 and a current version of Unity supports C#9.0 only
Yes, the generators generate C# 10 code. Is there no way to use C# 10 in Unity?
Have you tried the steps described in the "Installing an existing Roslyn analyzer or source generator" section of https://docs.unity3d.com/Manual/roslyn-analyzers.html?
Yes, the generators generate C# 10 code. Is there no way to use C# 10 in Unity?
nope, Mono doesn't support it yet
Have you tried the steps described in the "Installing an existing Roslyn analyzer or source generator" section of https://docs.unity3d.com/Manual/roslyn-analyzers.html?
I've also found it but haven't tried it yet, perhaps a little later, I'll tell you about the results here.
@CollinAlpert Okay I tried to follow those steps. It seems that you have newer versions of Microsoft.CodeAnalysis dependencies than it is allowed by Unity.
Unity suggests using Microsoft.CodeAnalysis.CSharp 3.8.0 in the manual. And it doesn't contain:
I guess the only solution here is to replace these dependencies somehow but I'm not sure if it's possible.
I see! If you want to fork this library and downgrade the dependencies, I could help you maintain it. As for IIncrementalGenerator
compared to ISourceGenerator
, I made the switch in the commit https://github.com/CollinAlpert/Lombok.NET/commit/ee788bb01a6e62eaa1bf5923853479b0b57a6241, so you could look at how the generators were constructed before that.
I don't think I'll dive into that soon enough or ever at all but thank you for your help! Perhaps someone would work on that someday later at least knowing what he has to do after we investigated the issue. Anyway, great project!
No worries, I get it :) I hope you manage to use the library at some other point.
Doesn't work with Unity 2021.3.1f1 (and probably with any other version). Will you consider supporting it?