Feedback on "assembly definition files"

I like the direction we’re heading with this. This change is long overdue, but i’m still happy to see it happen.

so why invent a new mechanism for defining what files belong to which assembly (C# project files) and the dependencies between these assemblies (C# solution files) ??

The easiest way would’ve been to allow us to specify our own solution. Unity would compile that solution when returning to the editor from another window. Solutions and C# projects already have the nice property of knowing whether they should recompile or not, so everything you’re offering here should still work.

Seems like a cumbersome solution that already exists to this problem.

Just a question. Is file approach better than to have all information about compilation stored in .meta of specific directory? and have nice IMGUI for that part? How does new system handles subdirectories? Do I have to specify in each subdirectory that file?

That’s described in the Assembly Definition Files documentation.

Haven’t tried it yet, but after reading the docs I’m also thinking it would be great to just have a way to override the assembly target for each folder through a nice UI. Is there any particular reason why we have to create json files instead?

It seems it’s just not ready yet, as LeonhardP said in this post:

I assume you are referring to .csproj and .sln files here, e.g. building the Unity project with msbuild.

The reason we did not take this approach, is because it would not be backwards compatible with how compilation current works in Unity. You would have to add the files to the .csproj every time you add a new script file, which is very different from how scripts are compiled today.

The long term goal for compilation of scripts in Unity is to provide an API that allows you to decide how the scripts are compiled, which would allow you to invoke msbuild, if you so desire.

An inspector for the assembly definition files will land before 2017.2 is released.

1 Like

@lukaszunity how about this?