The latest UnityEngine.UI has been added to this DLL, but it still Error to import the DLL.
Thank you for helping me.
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: ‘UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’
at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at APIUpdater.Framework.Core.AssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
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(AssemblyNameReference name, ReaderParameters parameters)
at APIUpdater.Framework.Core.AssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at Mono.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference name)
at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
at Mono.Cecil.TypeReference.Resolve()
at APIUpdater.Framework.Util.CecilExtensions.GenericParametersFor(TypeReference type)
at APIUpdater.Framework.Util.CecilExtensions.GenericArgumentsFor(TypeReference type)
at APIUpdater.Framework.Util.CecilExtensions.AsReferenceSpec(TypeReference self)
at AssemblyUpdater.Steps.MoveToNamespace.Visit(TypeReference typeReference, Context context)
at Unity.Cecil.Visitor.Visitor.VisitTypeReference(TypeReference typeReference, Context context)
at Unity.Cecil.Visitor.Visitor.Visit(GenericInstanceType genericInstanceType, Context context)
at Unity.Cecil.Visitor.Visitor.VisitTypeReference(TypeReference typeReference, Context context)
at Unity.Cecil.Visitor.Visitor.Visit(ParameterDefinition parameterDefinition, Context context)
at Unity.Cecil.Visitor.Visitor.Visit(MethodDefinition methodDefinition, Context context)
at Unity.Cecil.Visitor.Visitor.Visit(TypeDefinition typeDefinition, Context context)
at Unity.Cecil.Visitor.Visitor.Visit(ModuleDefinition moduleDefinition, Context context)
at Unity.Cecil.Visitor.Visitor.Visit(AssemblyDefinition assemblyDefinition, Context context)
at AssemblyUpdater.Steps.AssemblyUpdaterStepBase.Visit(AssemblyDefinition assemblyDefinition, Context context)
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[ ] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[ ] parameters) at Unity.Cecil.Visitor.Visitor.Visit[T](T node, Context context) at Unity.Cecil.Visitor.Extensions.DoAccept[T](T definition, Visitor visitor) at Unity.Cecil.Visitor.Extensions.Accept(AssemblyDefinition assemblyDefinition, Visitor visitor) at AssemblyUpdater.Steps.AssemblyUpdaterStepBase.Apply(AssemblyUpdaterContext context) at AssemblyUpdater.Core.AssemblyUpdaterPipeline.RunUpdateRound(AssemblyUpdaterContext context) at AssemblyUpdater.Core.AssemblyUpdaterPipeline.Run(AssemblyUpdaterContext context) at AssemblyUpdater.Application.Program.UpdateAssembly(UpdateOptions config, AssemblyUpdaterContext context) at AssemblyUpdater.Application.Program.<>c__DisplayClass0_0.<Main>b__1(UpdateOptions o) at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult1 result, Action1 action) at AssemblyUpdater.Application.Program.Main(String[ ] args) UnityEditor.Scripting.APIUpdaterLogger:WriteErrorToConsole (string,object[ ]) UnityEditorInternal.APIUpdating.APIUpdaterManager:HandleAssemblyUpdaterErrors (System.Collections.Generic.IList1<UnityEditorInternal.APIUpdating.AssemblyUpdaterUpdateTask>)
UnityEditorInternal.APIUpdating.APIUpdaterManager:UpdateAssemblies ()
UnityEditorInternal.APIUpdating.APIUpdaterManager:ProcessImportedAssemblies (string[ ])
Did you follow the steps outlined in the manual? https://docs.unity3d.com/Manual/UsingDLL.html
It’s important to reference the UnityEngine.UI from your project’s Library folder, not the one under Program Files (if there is any). And reference means adding an assembly reference, not copying the DLL into the DLL project folder or solution.
Thank you for answering my question.
I have added the latest UnityEngine.UI from my project’s Library folder.
This error occurs when I import a RWFramework.dll.
Hmmm have you tried building a DLL without referencing any UnityEngine.UI types in your code?
I wonder if it will then complain about some other missing DLL. That might indicate the DLL isn’t properly set up, it might be using a .NET Framework version that isn’t compatible with Unity (.NET 4.8 or .NET Standard 2.1). C# version should be 9.
Thank you very much. Your method reminded me. I commented out the API about UI one by one and finally found the problem.
protected void RWUIPassEventOne<RWType>(PointerEventData data, ExecuteEvents.EventFunction<RWType> function) where RWType : IEventSystemHandler
{
List<RaycastResult> results = new List<RaycastResult>();
EventSystem.current.RaycastAll(data, results);
GameObject current = data.pointerCurrentRaycast.gameObject;
foreach (RaycastResult t in results.Where(t => current != t.gameObject))
{
ExecuteEvents.Execute(t.gameObject, data, function);
break;
}
}
In this way the “ExecuteEvents EventFunction < RWType >”, is the problem.When this type of parameter is in the DLL, the previous problem occurs,I don’t know why, but all I have to do is remove this and it works, okay.
Thanks again for reminding me. This problem has been bothering me for a long time