Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix player builds and builds of play mode tests #623

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Joe-Tschirpig
Copy link

@Joe-Tschirpig Joe-Tschirpig commented Apr 2, 2019

Had to revert some changes in order to get builds working again. Not sure if this is the best way to go about it, but at least this works. Play mode tests were already working in builds, but the assembly just only being included in the Editor, so that's fixed too.

This allows playmode tests to be run on platform builds.
This just reverts a change that was making things work in the past. The error when building on Unity 2018.3.8f1 was:

TypeLoadException: Could not resolve type with token 01000052 (from typeref, class/assembly System.Security.SecuritySafeCriticalAttribute, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
  at (wrapper managed-to-native) System.MonoCustomAttrs.GetCustomAttributesInternal(System.Reflection.ICustomAttributeProvider,System.Type,bool)
  at System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x00013] in <91744f54f98f4b5d840497556a31caa1>:0 
  at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00037] in <91744f54f98f4b5d840497556a31caa1>:0 
  at System.Reflection.MonoMethod.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) [0x00000] in <91744f54f98f4b5d840497556a31caa1>:0 
  at Zenject.Internal.ReflectionTypeAnalyzer+<>c__DisplayClass7_1.<GetMethodInfos>b__1 (System.Type a) [0x00000] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\ZenReflectionTypeAnalyzer.cs:77 
  at System.Linq.Enumerable.Any[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x0002c] in <1d99ff3466ae4dc2aaaaa10b31d9f99b>:0 
  at Zenject.Internal.ReflectionTypeAnalyzer+<>c.<GetMethodInfos>b__7_0 (System.Reflection.MethodInfo x) [0x0000d] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\ZenReflectionTypeAnalyzer.cs:77 
  at System.Linq.Enumerable+WhereArrayIterator`1[TSource].ToList () [0x00019] in <1d99ff3466ae4dc2aaaaa10b31d9f99b>:0 
  at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <1d99ff3466ae4dc2aaaaa10b31d9f99b>:0 
  at Zenject.Internal.ReflectionTypeAnalyzer.GetMethodInfos (System.Type type) [0x00014] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\ZenReflectionTypeAnalyzer.cs:76 
  at Zenject.Internal.ReflectionTypeAnalyzer.GetReflectionInfo (System.Type type) [0x0004a] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\ZenReflectionTypeAnalyzer.cs:46 
  at Zenject.TypeAnalyzer.CreateTypeInfoFromReflection (System.Type type) [0x0000e] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\TypeAnalyzer.cs:232 
  at Zenject.TypeAnalyzer.GetInfoInternal (System.Type type) [0x00086] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\TypeAnalyzer.cs:213 
  at Zenject.TypeAnalyzer.TryGetInfo (System.Type type) [0x0001a] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\TypeAnalyzer.cs:131 
  at Zenject.TypeAnalyzer.TryGetInfo (System.Type type) [0x0006a] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\TypeAnalyzer.cs:143 
  at Zenject.TypeAnalyzer.TryGetInfo (System.Type type) [0x0006a] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\TypeAnalyzer.cs:143 
  at Zenject.TypeAnalyzer.TryGetInfo (System.Type type) [0x0006a] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\TypeAnalyzer.cs:143 
  at Zenject.TypeAnalyzer.TryGetInfo (System.Type type) [0x0006a] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\TypeAnalyzer.cs:143 
  at Zenject.TypeAnalyzer.HasInfo (System.Type type) [0x00001] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\TypeAnalyzer.cs:93 
  at Zenject.Internal.ZenUtilInternal.IsInjectableMonoBehaviourType (System.Type type) [0x00001] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\ZenUtilInternal.cs:211 
  at Zenject.Internal.ZenUtilInternal.GetInjectableMonoBehavioursUnderGameObjectInternal (UnityEngine.GameObject gameObject, System.Collections.Generic.List`1[T] injectableComponents) [0x000b9] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\ZenUtilInternal.cs:200 
  at Zenject.Internal.ZenUtilInternal.GetInjectableMonoBehavioursUnderGameObject (UnityEngine.GameObject gameObject, System.Collections.Generic.List`1[T] injectableComponents) [0x00002] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Util\ZenUtilInternal.cs:153 
  at Zenject.ProjectContext.GetInjectableMonoBehaviours (System.Collections.Generic.List`1[T] monoBehaviours) [0x0000d] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Install\Contexts\ProjectContext.cs:266 
  at Zenject.ProjectContext.Initialize () [0x0007c] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Install\Contexts\ProjectContext.cs:227 
  at Zenject.ProjectContext.InstantiateAndInitialize () [0x00097] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Install\Contexts\ProjectContext.cs:162 
  at Zenject.ProjectContext.get_Instance () [0x00011] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Install\Contexts\ProjectContext.cs:59 
  at Zenject.SceneContext.RunInternal () [0x00001] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Install\Contexts\SceneContext.cs:128 
  at Zenject.RunnableContext.Run () [0x00015] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Install\Contexts\RunnableContext.cs:36 
  at Zenject.RunnableContext.Initialize () [0x00016] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Install\Contexts\RunnableContext.cs:22 
  at Zenject.SceneContext.Awake () [0x00002] in D:\Source Tree\Repos\Match\Assets\Plugins\Zenject\Source\Install\Contexts\SceneContext.cs:113
@svermeulen
Copy link

Can you elaborate on b084857 a bit? Which build is broken due to that change? It's actually necessary to address #583

@svermeulen
Copy link

What do you need to bind to trigger that exception?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants