Compilation errors in Unity 6 with .NET Standard
Steps to reproduce:
- Create a new project with Unity 6000.0.27f1
- Platform is Windows
- Install the latest version of Needle Console via OpenUPM
- In
Project Settings > Player, setEditor Assemblies Compatibility Levelto.NET Standard
Expected result:
No compilation error.
Actual result:
Multiple compilation errors:
Library\PackageCache\com.needle.console\Editor\CustomConsole\Patch_ConsoleWindowListView.cs(36,44):
error CS7069: Reference to type 'LocalBuilder' claims it is defined in 'mscorlib', but it could not be found
Library\PackageCache\com.needle.console\Editor\CustomConsole\Patch_ConsoleWindowListView.cs(59,12):
error CS7069: Reference to type 'Label' claims it is defined in 'mscorlib', but it could not be found
Library\PackageCache\com.needle.console\Editor\CustomConsole\Patch_ConsoleWindowListView.cs(59,23):
error CS1503: Argument 1: cannot convert from 'System.Reflection.Emit.Label [C:\Programs\Unity\Hub\Editor\6000.0.27f1\Editor\Data\NetStandard\ref\2.1.0\netstandard.dll]'
to 'System.Reflection.Emit.Label [C:\Programs\Unity\Hub\Editor\6000.0.27f1\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\mscorlib.dll]'
Thanks for reporting this. I will investigate as soon as possible. Please let me know if you purchased a license for Needle Console.
In the meantime you could try to update the harmony dependency used in the project and let me know if that changes anything
Please let me know if you purchased a license for Needle Console.
I don't have one. I use Needle Console on open sourced projects only.
Same here. Using Linux and also .NET Standard for editor. Cannot use it meanwhile (it does not compile).
Finally got some time to reproduce the issue, sorry for the delay. The compilation error should be gone with version 2.4.3 but unfortunately I didn't find a way to allow using System.Reflection with .Net Standard in the time available so Needle Console will not be able to patch the Unity console in the meantime (this only affects cases where the Unity Editor assembly compilation level is set to .NET Standard. The default settings using .NET Framework will work as before)
If anyone has a workaround or fix to allow access to the System.Reflection.Emit namespace (to use e.g. LocalBuilder) i'd be happy to accept PRs