fix(163): Update zenject.asmdef to specify all default values
Pull request checklist
Please check if your PR fulfills the following requirements:
- [x] Tests for the changes have been added (for bug fixes / features)
- [x] Docs have been reviewed and added / updated if needed (for bug fixes / features)
- [x] No compiler errors or warnings
Pull request type
Please check the type of change your PR introduces:
- [X] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):
Issue Number
Issue Number: #163
What is the current behavior?
- zenject.asmdef is not recognized by unity inspector and therefore the project cannot be used.
What is the new behavior?
zenject.asmdef is recognized by unity inspector and the project therefore can be referenced and used.
Does this introduce a breaking change?
- [ ] Yes
- [ ] No
- [X] Maybe: It is unclear if all versions of unity that zenject might support treat the asmdef the same and if older versions might have been able to read the old asmdef but newer versions don't. This would be a breaking change introduced by unity.
Other information

- ignore /UserSettings/* e.g. EditorUserSettings.asset (see Unity post https://forum.unity.com/threads/whats-the-usersettings-directory.754436/#post-5029937)
On which Unity version has this been tested?
- [ ] 2020.4 LTS
- [ ] 2020.3
- [X] 2020.2.1f1
- [ ] 2020.1
- [ ] 2019.4 LTS
- [ ] 2019.3
- [ ] 2019.2
- [ ] 2019.1
- [ ] 2018.4 LTS
Scripting backend:
- [X] Mono
- [ ] IL2CPP
Note: Every pull request is tested on the Continuous Integration (CI) system to confirm that it works in Unity.
Ideally, the pull request will pass ("be green"). This means that all tests pass and there are no errors. However, it is not uncommon for the CI infrastructure itself to fail on specific platforms or for so-called "flaky" tests to fail ("be red"). Each CI failure must be manually inspected to determine the cause.
CI starts automatically when you open a pull request, but only Releasers/Collaborators can restart a CI run. If you believe CI is giving a false negative, ask a Releaser to restart the tests.
Fixed build error by replacing zenject.ref.asmref with Zenject.SampleBuilder.Editor.asmdef which is only included in the editor to avoid usage of UnityEditor outside of the editor. Build project (win x64, 2020.1.2f1) to ensure it builds.

Reset project to 2019.3.0
... And by resetting the project version I've lost the actual fix.
This is a known Unity issue. Simply put: they messed up the assembly definitions starting with 2019.1 and changed it's behavior with every update. 2020 is for Unity a 'FIX' year. They changed their release cycle to two releases each year. So hopefully they have this right with 2020.2/LTS. BTW the same goes for UPM. They have taken all their devs of their feature projects. And have them working on fixes.
Reapplied the original changes in 2020.1.2f1 but pushed without the project version upgrade to avoid failing to build. Added .asmdef for SampleGame1 and SampleGame2 which are required if Zenject is not set to auto reference, which no asmdef ever should be that is not required to be referenced everywhere.
@Mathijs-Bakker thanks. Should this PR be declined and we wait for the Unity fix instead?
The file zenject.asmdef got renamed to Zenject.asmdef, but the corresponding *.meta file wasn't renamed to Zenject.asmdef.meta accordingly. On Windows, this shouldn't make a noticeable difference, but on any other system (with case sensitive paths), this could lead Unity to detect the *.meta file as a stray one for a non existing asmdef and remove it, and regenerating the one for the actual asmdef, causing a regeneration of the GUID.
TLDR: please also rename the *.meta file to avoid issues
Regarding the Unity-behavior regarding the asmdefs: I didn't do testing specifically to test this behavior, but based on my experience with the Unity serialization, I don't think this should negatively affect projects using an older version of Unity. I might test out what Untiy 2019 does if it's presented with the altered asmdef.