Code Monkey home page Code Monkey logo

Comments (12)

mob-sakai avatar mob-sakai commented on May 25, 2024 2

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.

from csharpcompilersettingsforunity.

mob-sakai avatar mob-sakai commented on May 25, 2024 2

@VolodymyrBS @SugoiDev
I found a work-around!
Please try to use 1.4.0-preview.1!

from csharpcompilersettingsforunity.

mob-sakai avatar mob-sakai commented on May 25, 2024 2

I've create a new issue for 2021.1.0.

from csharpcompilersettingsforunity.

mob-sakai avatar mob-sakai commented on May 25, 2024 2

Version 1.4.0 has been released.

from csharpcompilersettingsforunity.

SugoiDev avatar SugoiDev commented on May 25, 2024 1

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.

from csharpcompilersettingsforunity.

SugoiDev avatar SugoiDev commented on May 25, 2024 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

from csharpcompilersettingsforunity.

VolodymyrBS avatar VolodymyrBS commented on May 25, 2024 1

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

from csharpcompilersettingsforunity.

github-actions avatar github-actions commented on May 25, 2024

🎉 This issue has been resolved in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

from csharpcompilersettingsforunity.

VolodymyrBS avatar VolodymyrBS commented on May 25, 2024

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?

from csharpcompilersettingsforunity.

mob-sakai avatar mob-sakai commented on May 25, 2024

@SugoiDev
Thanks!

from csharpcompilersettingsforunity.

VolodymyrBS avatar VolodymyrBS commented on May 25, 2024

do you have plan to release version 1.4.0 out of preview any time soon?

from csharpcompilersettingsforunity.

mob-sakai avatar mob-sakai commented on May 25, 2024

@VolodymyrBS ASAP!

from csharpcompilersettingsforunity.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.