ssannandeji / Zenject-2019

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

baking broken in 8.0.0 #603

Open extrawurst opened 5 years ago

extrawurst commented 5 years ago

After upgrading to 8.0.0 baking seems to be broken. I get No reflection baking info found... warnings for everything, my own classes and Unity's. Eventhough I am using All Generated Assemblies

schodemeiss commented 5 years ago

Which version of Unity was this with? Did you ever figure out the solution?

extrawurst commented 5 years ago

this is unity 2018.3.8f1

svermeulen commented 5 years ago

I just tried building the sample projects in Unity 2019, and baking worked as expected there. Is it possible that the library with those classes is not referencing the zenject project? In that case, that library is skipped

metamorphling commented 5 years ago

Tried to update for this feature, did not work out as well(tested in editor). Using assembly definitions I have around a hundred of libraries and reflection baking throws around 700 warnings. I'm not sure if it was able to bake anything in the first place. Sorry for not being able to provide an example to show the issue. Are there any requirements in placement of baking settings? I put it under "resources" of the main project, next to project context which handles a bunch of mono installers. EDIT: In log I see Added reflection baking to '411' types in assembly 'Zenject.dll', took 0.55 seconds Added reflection baking to '11' types in assembly 'Zenject-Editor.dll', took 0.05 seconds Added reflection baking to '5' types in assembly 'Zenject-PoolMonitor-Editor.dll', took 0.03 seconds Added reflection baking to '15' types in assembly 'Zenject-ReflectionBaking-Editor.dll', took 0.05 seconds

If I turn off "All Generated Assemblies" I am able to see the giant list of dlls under "Include Assemblies", but adding them manually does not help either.

ajon542 commented 5 years ago

I had what seems like a similar issue. After some debugging, I found that I needed to add my own namespace pattern "^" to match all namespaces within the given assemblies. By default, Zenject adds "^Zenject" as the only namespace pattern which causes other namespaces to fail the match when searching the assemblies. See the "Run" method in ReflectionBakingModuleEditor.cs.