Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

"TargetParameterCountException: parameters do not match signature". Okay, which function?

Discussion in 'Editor & General Support' started by MrDude, Sep 27, 2018.

  1. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Hi there

    I started seeing this error pop up all of a sudden and have no idea what is causing it or how to figure that out.
    How can I determine the cause of this and get it to stop?
    Thanks

    Code (csharp):
    1. TargetParameterCountException: Number of parameters specified does not match the expected number.
    2. System.Reflection.MonoMethod.ConvertValues (System.Reflection.Binder binder, System.Object[] args, System.Reflection.ParameterInfo[] pinfo, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) (at <f2e6809acb14476a81f399aeb800f8f2>:0)
    3. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <f2e6809acb14476a81f399aeb800f8f2>:0)
    4. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <f2e6809acb14476a81f399aeb800f8f2>:0)
    5. UnityEditor.EditorAssemblies.ProcessInitializeOnLoadMethod (System.Reflection.MethodInfo method) (at C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:116)
    6. UnityEditor.EditorAssemblies.ProcessInitializeOnLoadAttributes () (at C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:135)
    7.  
    EDIT: SOLVED:
    Of course, after ages of wondering about it I discover the answer myself only a minute after finally posting the question here... Sigh... Facepalm.

    Turns out I was using the ProcessInitializeOnLoadMethod directive on a function and later changed the function to require a parameter. Voila. Instant problem created. The fix just required a simple //
    :) Sorry for wasting your time!
     
    Last edited: Sep 27, 2018
unityunity