When referencing Unity packages via Assembly Definition References - Use GUIDs or name?

My custom packages often use Unity packages (e.g. Unity.Settings.Editor for SettingsManagement). When I add a reference to this package in my own ASMDEF, should I use the “Use GUIDs” or better rely on the assembly name?

I guess this is the question of whether it is more likely that my reference might break someday because Unity renames the package assembly or the GUID is reassigned with a new release.

Hello, it would be good practice to use the GUID since this is the default behavior and it will never be reassigned. That being said, it should make very little difference what option you use in this case.

1 Like

OK, thanks for this tip! I’m also interested, for what use case would I want the name instead of the GUID?

The way I see it, using the name is more of a fallback for situations where using the GUID is not possible. It could be that your flow depends on importing assemblies “on the fly” for which the meta file was not pre-generated, or that you’d like to swap seamlessly between two versions of the same assembly by a simple move & rename. It could be a lifesaver in some of those fringe cases :slight_smile:

1 Like

I use names myself because they are self explanatory in a diff on version control, and it’s easier to mass edit asmdef files with a text editor to modify references.

7 Likes