Fix CS1705 on Unity 6000.5: downgrade bundled Roslyn 4.14 → 4.12#56
Merged
Conversation
Fix CS1705 on Unity 6000.5: downgrade bundled Roslyn 4.14 -> 4.12 Unity 6000.5 (.NET 8) ships System.Collections.Immutable 8.0 in its netstandard2.1 targeting pack, which shadows the bundled Immutable 9.0 that Roslyn 4.14 requires, so UnityCtl.dll fails to compile (CS1705). Roslyn 4.12 targets Immutable 8.0, matching what 6000.5 provides. Swaps the bundled Plugins/Roslyn DLLs: - Microsoft.CodeAnalysis(.CSharp) 4.14 -> 4.12 - System.Collections.Immutable / System.Reflection.Metadata 9.0 -> 8.0 (Unsafe 6.0 and Text.Encoding.CodePages 7.0 unchanged.) Same C# 13 language support (C# 14 needs Roslyn 5.0 / .NET 10), so no script-eval capability is lost. Verified script eval + snapshot --id round-trips clean on both 6000.3.15f1 and 6000.5.0f1. Reported by @bradar93 in #54. @
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Unity 6000.5 (.NET 8), the bundled Roslyn 4.14 fails to compile the
UnityCtl.dlleditor assembly:6000.5 ships
System.Collections.Immutable8.0 in its netstandard2.1 targeting pack, which shadows the bundled 9.0 that Roslyn 4.14 requires. Reported by @bradar93 in #54.Fix
Downgrade the bundled
Editor/Plugins/RoslynDLLs to the Roslyn 4.12 set, which targets Immutable 8.0 (matching what 6000.5 provides):Microsoft.CodeAnalysis/Microsoft.CodeAnalysis.CSharp4.14 → 4.12System.Collections.Immutable/System.Reflection.Metadata9.0 → 8.0System.Runtime.CompilerServices.Unsafe6.0 andSystem.Text.Encoding.CodePages7.0 unchangedNo capability lost
Roslyn 4.12, 4.13, and 4.14 all max out at C# 13 (.NET 9 / VS 17.x). C# 14 requires Roslyn 5.0 / .NET 10, so the downgrade unlocks nothing we would otherwise have.
script evalcompiles C# 13 and earlier — unaffected.Testing
Verified on a live editor for both versions:
UnityCtl.dllcompiles, plugin connects,script eval "return 2+2"→ 4, andsnapshot --id 568105584918841322(a real 64-bit EntityId) round-trips.script evalandsnapshot --idround-trip.