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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Setting root namespace seems to have no effect

Discussion in 'Editor & General Support' started by MidniteOil, Jan 17, 2022.

  1. MidniteOil

    MidniteOil

    Joined:
    Sep 25, 2019
    Posts:
    341
    Greetings,

    I'm using Visual Studio 2019 as my editor with Unity.
    I have set the Root namespace in my Project settings:
    upload_2022-1-17_14-6-45.png

    I've also edited the root namespace in the csproj for my assembly:
    upload_2022-1-17_14-10-7.png

    Yet, when I create a new C# script from within unity it is not putting it in a namespace. I have to manually add the namespace every time.

    I'm sure I'm overlooking something simple.

    Can anyone help?

    Thanks!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,780
  3. unity_ctg0ujCJYRi52g

    unity_ctg0ujCJYRi52g

    Joined:
    Jun 1, 2020
    Posts:
    11
    Hi,
    I had the same problem.
    You need to set it up in the Assembly Definition file. (you may have multiple in your project! So you need to set it up inside the correct one!). upload_2022-8-1_16-51-41.png
     
    Noble-Woods and Nit_Ram like this.