ssannandeji / Zenject-2019

Dependency Injection Framework for Unity3D
MIT License
2.53k stars 366 forks source link

User Error -> StackOverflow AssertHit! (999+ times) #664

Open vertis opened 4 years ago

vertis commented 4 years ago

I managed to get a very nasty error by accidentally putting a MonoInstaller in the list of PrefabInstallers (attached to SceneContext).

This is a user error, in that I just wasn't paying enough attention when I added the installer, but it did result in Unity freezing for quite a while and then printing Zenject Exception: Assert hit! 999+ times to the console.

Aside from locking Unity up for a minute or two the error message is less than obvious (especially for a beginner).

Steps to reproduce:

  1. Add SceneContext
  2. Create MonoInstaller
  3. Add MonoInstaller as component of SceneContext gameobject
  4. Add MonoInstaller to PrefabInstaller list
  5. Run project

Without ever having touched the prefab installer before, I'm guessing this causes it to instatiate itself in an infinite loop.

I'm running Unity 2019.1.14f1 (though I doubt that matters).

nexxogen commented 4 years ago

I wholeheartedly recommend that you switch to this repo:

https://github.com/svermeulen/Extenject

It is maintained by the original Zenject author and unlike ModestTree who only know how to sue, but not provide support for "their" software, he actually still maintains Zenject. Just post your question there and you will most likely get an answer.

vertis commented 4 years ago

@nexxogen wow! Thanks for the tip