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

TargetInvocationException when importing Hover DLLs in Unity 5.2 #33

Closed
zachkinstner opened this issue Sep 30, 2015 · 6 comments
Closed
Assignees
Labels

Comments

@zachkinstner
Copy link
Member

With both Unity 5.2.1f1 and Unity 5.2.1p1, using the latest changes (in the master branch) for new Unity/Oculus/Leap support -- the Unity editor reports the following error when importing the Hover DLLs into the project. As far as I can tell, I have the correct UnityEngine.UI.dll reference.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
  at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.DefaultAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.MetadataResolver.Resolve (Mono.Cecil.TypeReference type) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.ModuleDefinition.Resolve (Mono.Cecil.TypeReference type) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.TypeReference.Resolve () [0x00000] in <filename unknown>:0 
  at AssemblyUpdater.Steps.MemberReferenceReplacer.MemberReferenceReplacementForProperty (Mono.Cecil.MethodReference method) [0x00000] in <filename unknown>:0 
  at AssemblyUpdater.Steps.MemberReferenceReplacer.MemberReferenceReplacementFor (Mono.Cecil.MethodReference methodReference) [0x00000] in <filename unknown>:0 
  at AssemblyUpdater.Steps.MemberReferenceReplacer.Visit (Mono.Cecil.MethodReference methodReference, Unity.Cecil.Visitor.Context context) [0x00000] in <filename unknown>:0 
  at Unity.Cecil.Visitor.Visitor.Visit (Mono.Cecil.Cil.Instruction instruction, Unity.Cecil.Visitor.Context context) [0x00000] in <filename unknown>:0 
  at Unity.Cecil.Visitor.Visitor.Visit (Mono.Cecil.Cil.MethodBody methodBody, Unity.Cecil.Visitor.Context context) [0x00000] in <filename unknown>:0 
  at Unity.Cecil.Visitor.Visitor.Visit (Mono.Cecil.MethodDefinition methodDefinition, Unity.Cecil.Visitor.Context context) [0x00000] in <filename unknown>:0 
  at Unity.Cecil.Visitor.Visitor.Visit (Mono.Cecil.PropertyDefinition propertyDefinition, Unity.Cecil.Visitor.Context context) [0x00000] in <filename unknown>:0 
  at Unity.Cecil.Visitor.Visitor.Visit (Mono.Cecil.TypeDefinition typeDefinition, Unity.Cecil.Visitor.Context context) [0x00000] in <filename unknown>:0 
  at Unity.Cecil.Visitor.Visitor.Visit (Mono.Cecil.ModuleDefinition moduleDefinition, Unity.Cecil.Visitor.Context context) [0x00000] in <filename unknown>:0 
  at Unity.Cecil.Visitor.Visitor.Visit (Mono.Cecil.AssemblyDefinition assemblyDefinition, Unity.Cecil.Visitor.Context context) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at Unity.Cecil.Visitor.Visitor.Visit[AssemblyDefinition] (Mono.Cecil.AssemblyDefinition node, Unity.Cecil.Visitor.Context context) [0x00000] in <filename unknown>:0 
  at Unity.Cecil.Visitor.Extensions.DoAccept[AssemblyDefinition] (Mono.Cecil.AssemblyDefinition definition, Unity.Cecil.Visitor.Visitor visitor) [0x00000] in <filename unknown>:0 
  at Unity.Cecil.Visitor.Extensions.Accept (Mono.Cecil.AssemblyDefinition assemblyDefinition, Unity.Cecil.Visitor.Visitor visitor) [0x00000] in <filename unknown>:0 
  at AssemblyUpdater.Steps.AssemblyUpdaterStepBase.Apply (AssemblyUpdater.Core.AssemblyUpdaterContext context) [0x00000] in <filename unknown>:0 
  at AssemblyUpdater.Core.AssemblyUpdaterPipeline.Run (AssemblyUpdater.Core.AssemblyUpdaterContext context) [0x00000] in <filename unknown>:0 
  at AssemblyUpdater.Application.Program.CheckForObsoleteAPIUsage (AssemblyUpdater.Application.CommandLineSpec config) [0x00000] in <filename unknown>:0 
  at AssemblyUpdater.Application.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
UnityEditor.Scripting.APIUpdaterHelper:DoesAssemblyRequireUpgrade(String)
@zachkinstner zachkinstner added this to the Near-Term milestone Sep 30, 2015
@zachkinstner zachkinstner self-assigned this Sep 30, 2015
@zachkinstner
Copy link
Member Author

I found a similar Unity issue 718709:

System.Reflection.TargetInvocationException importing plugin

The Unity 5.2.1p0 patch release says that it's fixed:

(718709) - API Updater: Fixed crash in AssemblyUpdater when a type had methods with names starting with get_/set_ .

However, using the latest patched release (Unity 5.2.1p1) hasn't resolved the issue.

@zachkinstner
Copy link
Member Author

After the DLLs are imported, the error message doesn't appear again. It does not seem to affect the scene or functionality in any way.

The stack trace starts at DoesAssemblyRequireUpgrade(). Since the Visual Studio project references the latest UnityEngine.UI.dll assembly, it seems safe to say that it doesn't require an upgrade.

@zachkinstner
Copy link
Member Author

This error will appear when importing Hover VR v1.4.0. I'm not sure how to avoid it, but for now, the error message seems harmless. Perhaps this is a bug on the Unity side. Any ideas?

@kruncher
Copy link

I am having the same issue with my asset; I haven't been able to figure out the cause.

If you figure this out it would be great if you could share the cause; likewise, I will do same if I manage to find the cause first :)

@zachkinstner
Copy link
Member Author

Hi @kruncher, I'll definitely post back here if I find a solution. If you have an issue/ticket for this issue on your project, feel free to link to it here.

That Unity bug ticket referenced above now has a comment ("Still not fixed in 5.2.1f1....") so hopefully Unity knows that the error message is still occurring for us. Edit: I just added a note there, too.

@zachkinstner
Copy link
Member Author

I did not notice this issue when importing the v2.0.0A (alpha) release in Unity 5.4.1f1. I will close this issue for now.

@zachkinstner zachkinstner removed this from the Near-Term milestone Nov 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants