Closed mob-sakai closed 3 years ago
I just try upgrade my C#9 test project to Unity 2020.2.0b11 and it's says that I have compilation errors and show safe mode pop-up. If I click "Ignore" it start compiling by compiler that I choose (in my case Microsoft.Net.compiler.Toolset 3.8.0). If I chose enter safe mode it shows c# 9 syntax features as error. also it fails if I start build in batch mode.
did I miss something?
https://forum.unity.com/threads/invitation-to-try-out-unity-safe-mode.925043/page-2#post-6536662
On previous Unity versions code in precompiled assemblies marked with InitializeOnLoad could be run before compiler.
Yes. This plugin is based on this "specification." I'm looking for a workaround.
It was confirmed as an intentional change: https://forum.unity.com/threads/invitation-to-try-out-unity-safe-mode.925043/page-2#post-6555160
Hi. At startup it isn't possible to run user code before compilation, if compilation is needed. It is correct that before 2019.3 that Unity at startup would load domain with user assemblies before compilation, even though if there were new scripts. This was considered a problematic and therefore the order was changed.
@VolodymyrBS @SugoiDev
I found a work-around!
Please try to use 1.4.0-preview.1
!
On 2021.1.a9 the "Apply" button is causing an exception, so I couldn't test it yet.
[Exception] InvalidOperationException: Sequence contains no matching element
Enumerable.First[TSource]() at <351e49e2a5bf4fd6beabb458ce2255f3>:0
ReflectionExtensions.Call() at <26e68dbb771b4491aa5f1dc8f99cc436>:0
Utils.RequestCompilation() at <26e68dbb771b4491aa5f1dc8f99cc436>:0
CscSettingsProvider+<>c.<OnGUI>b__9_1() at Library/PackageCache/com.coffee.csharp-compiler-settings@88d8659a14/Editor/CscSettingsProvider.cs:100
98: serializedObject.ApplyModifiedProperties();
99: File.WriteAllText(CscSettingsAsset.k_SettingsPath, JsonUtility.ToJson(serializedObject.targetObject, true));
-->100: Utils.RequestCompilation();
101: },
102: onReload: () =>
InspectorGUI.DrawControl() at Library/PackageCache/com.coffee.csharp-compiler-settings@88d8659a14/Editor/InspectorGUI.cs:175
174: if (onApply != null && GUILayout.Button(s_ApplyText))
-->175: onApply();
176: }
CscSettingsProvider.OnGUI() at Library/PackageCache/com.coffee.csharp-compiler-settings@88d8659a14/Editor/CscSettingsProvider.cs:94
93: // Controls
-->94: InspectorGUI.DrawControl(serializedObject.hasModifiedProperties,
95: onRevert: () => { serializedObject = new SerializedObject(CscSettingsAsset.instance); },
96: onApply: () =>
SettingsProvider.OnGUI() at <a19e86c7bf354115a4c6a5953c0575cb>:0
@SugoiDev Thanks!
just tried with Unity 2020.2.1f1 and it's work without any errors with normal editor launch and in batch mode!🎉
also I tried Unity 2021.1.0b1 and had Enter Safe Mode message. after exiting safe mode I has same error @SugoiDev had
I've create a new issue for 2021.1.0.
do you have plan to release version 1.4.0 out of preview any time soon?
@VolodymyrBS ASAP!
Version 1.4.0
has been released.
:tada: This issue has been resolved in version 1.3.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket: