Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Unity miss to create the folder UserSettings in 2020.x

Discussion in '2020.2 Beta' started by Quatum1000, Aug 17, 2020.

  1. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    When Unity rebuild the directory structure, after completely deleting all folders excluding the project/asset folder (for updating purposes) then it miss to create the /UserSettings folder in the project directory.

    When the BuildManager try to save the BuildManagerSettings.asset file into /UserSettings, and it does not exist, Unity pops an Error. The BuildManager should take care of the folders in a path and create missing folders if required.

    Library/PackageCache/com.unity.entities@0.2.0-preview.18/Unity.Build.Common/BuildManager.cs:97

    Code (CSharp):
    1.     [Serializable]
    2.     public class BuildManager : EditorWindow
    3.     ...
    4.     ...
    5.         private void OnDisable()
    6.         {
    7.             File.WriteAllText(kSettingsPath, EditorJsonUtility.ToJson(this));
    8.         }
    9.  
    Sorry, I do not have the time to write a bug report.


    DirectoryNotFoundException: Could not find a part of the path "F:\Dropbox\ProjectX\UserSettings\BuildManagerSettings.asset".
    System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) (at <437ba245d8404784b9fbab9b439ac908>:0)
    (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
    System.IO.StreamWriter.CreateFile (System.String path, System.Boolean append, System.Boolean checkHost) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding) (at <437ba245d8404784b9fbab9b439ac908>:0)
    (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string,bool,System.Text.Encoding)
    System.IO.File.WriteAllText (System.String path, System.String contents, System.Text.Encoding encoding) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.IO.File.WriteAllText (System.String path, System.String contents) (at <437ba245d8404784b9fbab9b439ac908>:0)
    Unity.Build.Common.BuildManager.OnDisable () (at Library/PackageCache/com.unity.entities@0.2.0-preview.18/Unity.Build.Common/BuildManager.cs:97)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,739
    (that's a very old version of the entities package...)
     
  3. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Unfortunately that happend on each start. Changes are made in any package are not resistant and will be overwritten to default each time unity starts.