Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Can't Generate DOTS C# Solution

Discussion in 'Project Tiny' started by AlexisSphero, Jan 7, 2021.

  1. AlexisSphero

    AlexisSphero

    Joined:
    Oct 29, 2020
    Posts:
    12
    I had downloaded the project Tiny samples, and using the Tiny3D project as a base started prototyping a project.

    I got far enough along that I set up my own repo moved the files over, renamed many of them to get rid of the name Tiny3D and use my project name. I can still Build and Run the project, but I can no longer Generate a DOTS C# solution in my new project.

    When I go to Assets/Generate DOTS C# Solution I just get an empty tab with no options/buttons etc.

    I do get this error in the console:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Unity.Entities.Runtime.Build.GenerateDotsSolutionWindow+GenerateDotsSolutionView+RootAssemblyInfo.GetHashCode () (at Library/PackageCache/com.unity.dots.runtime@0.31.0-preview.24/Unity.Entities.Runtime.Build.Editor/GenerateDotsSolution.cs:623)
    3. System.Collections.Generic.GenericEqualityComparer`1[T].GetHashCode (T obj) (at <9577ac7a62ef43179789031239ba8798>:0)
    4. System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <9577ac7a62ef43179789031239ba8798>:0)
    5. System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <9577ac7a62ef43179789031239ba8798>:0)
    6. Unity.Entities.Runtime.Build.GenerateDotsSolutionWindow+GenerateDotsSolutionView.BuildRoot () (at Library/PackageCache/com.unity.dots.runtime@0.31.0-preview.24/Unity.Entities.Runtime.Build.Editor/GenerateDotsSolution.cs:670)
    7. UnityEditor.IMGUI.Controls.TreeView+TreeViewControlDataSource.FetchData () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewControl/TreeViewControlDataSource.cs:53)
    8. UnityEditor.IMGUI.Controls.TreeViewDataSource.ReloadData () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewDataSource.cs:54)
    9. UnityEditor.IMGUI.Controls.TreeView+TreeViewControlDataSource.ReloadData () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewControl/TreeViewControlDataSource.cs:25)
    10. UnityEditor.IMGUI.Controls.TreeViewController.ReloadData () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:297)
    11. UnityEditor.IMGUI.Controls.TreeView.Reload () (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewControl/TreeViewControl.cs:114)
    12. Unity.Entities.Runtime.Build.GenerateDotsSolutionWindow+GenerateDotsSolutionView..ctor (UnityEditor.IMGUI.Controls.TreeViewState state) (at Library/PackageCache/com.unity.dots.runtime@0.31.0-preview.24/Unity.Entities.Runtime.Build.Editor/GenerateDotsSolution.cs:275)
    13. Unity.Entities.Runtime.Build.GenerateDotsSolutionWindow.OnEnable () (at Library/PackageCache/com.unity.dots.runtime@0.31.0-preview.24/Unity.Entities.Runtime.Build.Editor/GenerateDotsSolution.cs:66)
    14. UnityEditor.EditorWindow:GetWindow()
    15. Unity.Entities.Runtime.Build.GenerateDotsSolutionWindow:ShowWindow() (at Library/PackageCache/com.unity.dots.runtime@0.31.0-preview.24/Unity.Entities.Runtime.Build.Editor/GenerateDotsSolution.cs:121)
    16.  
    I assume somehow I didn't copy something over, or that I mis-configured things when I renamed the scenes. How do I get the options back so I can make a C# solution?

    Update:
    So I've made a little progress. By simply opening editing my C# scripts without worrying about the DOTS solution I was able to get the window to populate. I now see the buttons to open and generate a solution, but they are greyed out, and I can't make any choices because it says "No BuildConfiguration Assets Found in Project".

    I do have several build configuration in Assets/Build folder, so how do I get the editor to see them? There doesn't appear to be an option to import any. I am able to use those configurations to run a build, so they are working, they just don't seem to be linked correctly.
     
    Last edited: Jan 7, 2021
  2. Zindea

    Zindea

    Joined:
    Mar 8, 2015
    Posts:
    25
    Ok first of this code has to do with the Main Assembly Name. This line to be exact:
    Code (CSharp):
    1.  public override int GetHashCode()
    2.                 {
    3.                     return ProjectName.GetHashCode();
    4.                 }
    You are getting a NullReferenceException because ProjectName or RootAssembly has not yet been defined.

    Double check your Build Settings main Assembly and double check if all the names are correct.
     
    AlexisSphero likes this.
  3. AlexisSphero

    AlexisSphero

    Joined:
    Oct 29, 2020
    Posts:
    12
    Thanks that was it. I had only updated the Build Settings I was using with the correct names so I still had a bunch of build settings for platforms I wasn't using hanging around that didn't have the new names.