Hello,
It would be great if there was a way to specify the root namespace for rider/unity projects.
I raised this in the unity forum and got redirected to this issue tracker.
Post: https://forum.unity.com/threads/rider-asmdef-namespace.852121/#post-5619076
I think a great way to solve this would be to be able to specify it inside the .asmdef file.
There us already a way to specify a package name, but using this would restrict the root namespace to the package name, not sure if this would be desired or not.
Having an additional field might require coordination with unity team.
I am unsure if VisualStudio has similiar issues or how it is handled, since .csproj files are generated on the fly it is not really possible to provide this info to the package.
Here is my .asmdef for a local package
Here is the warning about my namespace:
Maybe there are other ways to solve this, would be happy if there is a solution or maybe I am missing something that it is already possible and I am doing something wrong.
Thank you
A workaround to the issue with namespaces in the Packages/ folder could be handled the same way as with namespaces in the Assets folder, strip away "Packages/" when suggesting namespace. This is not the best solution, and I would like to handle namespaces within assembly-definitions, but it helps with avoiding the basic namespace clutter.

As a workaround you may switch from UnityExplorer to SolutionExplorer. Right click on packages folder would allow to uncheck Namespace Provider for it.

See also RIDER-36546
Hey @citizenmatt,
Now that Unity 2020.2 added support for rootNamespace in .Asmdef, is there a plan to support it in Rider?
Rider package 2.0.6 would have it, when combined with Unity 2020.2. @Nirlah
And #1677 and #1689 both handle the case where an assembly definition has a root namespace. Folders in the assembly definition project are used as namespace segments against the root namespace.
I'm going to close this now, as it's really a Unity feature that is solved with Unity 2020.2 and supported by Rider 2020.2.
@van800 I love you, man. You just made my life easier
Most helpful comment
As a workaround you may switch from UnityExplorer to SolutionExplorer. Right click on packages folder would allow to uncheck Namespace Provider for it.
