-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assembly definition root namespace behaviour #2427
Comments
Could you provide an example, please? This should generate a |
The root namespace in the csproj file is the same as in the assembly definition. The problem is that asmdef parent directories work as namespace providers for the project files. For example, I have two files:
The asmdef has the As a workaround I manually disable the |
Running into this exact problem at the moment as well Is there any workarounds for that? JetBrains Rider 2024.1.2 / Unity 2022.3.30 |
I've came across the same problem with custom packages installed locally in a project. To install a custom package locally, the Unity team suggest to put it under the Then, according to their documentation they recommend to put the tests under the I've done these steps and set the root namespace accordingly. For editor tests it is set to It seems somewhat correct because when I switch to the Solution view, the given project says that the files are in the following folder hierarchy: So I'm not sure that my problem is actually the same, but the other might have experienced the same and the root cause might be the same. |
@citizenmatt Any update for this? In the folder, I have two files: an asmdef and a script. I am using the asmdef like this: {
"name": "Lib.{FeatureName}.Controller",
"rootNamespace": "Lib.{FeatureName}.Controller",
"references": []
} However, in the script, Rider insists on replacing the namespace with something like:
This namespace matches exactly with the script's folder structure. I have already set the |
Setting the asmdef root namespace doesn't exclude parent directories from namespace providers. So, it just sets a new namespace prefix.
As I remember, it should replace all parent directories. At least that behaviour is described in the source code comment and I believe it used to work this way.
My environment:
com.unity.ide.rider
3.0.26The text was updated successfully, but these errors were encountered: