enisn Posted December 9, 2018 Share Posted December 9, 2018 (edited) Server crashed with no message when a player connected. In the logs I could't find something, but there is no StackTrace in logs and I can not understand anything. ==================[9.12.2018 12:46:10]================== System.Reflection.TargetParameterCountException: Parameter count mismatch. at object[] System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) ========================================================= Most probably reason is a Event takes only 1 argument but API tries to put it as object[] like: (via: System.Reflection.TargetParameterCountException: Parameter count mismatch on StackoverFlow) var obj = "MyParam1"; //Comes from client //uses this method.Invoke(instance, obj); //instead of this. method.Invoke(instance, new [] { obj }); //or this control doesn't exist if(obj is IEnumerable) method.Invoke(instance, obj); else method.Invoke(instance, new [] { obj }); I really can't find the problem. Log isn't enough to find exception. Because exception throws in external assembly and it doesn't have information enough. -- EDIT-- I've commented all ServerEvents, and there is no problem. I tried uncomment one by one, but I recognized, I can't use any of ServerEvent. I uncommented PlayerConnected and crashed again when player connects. same thing happens PlayerDisconnected. Reflection doesn't triggers my ServerEvents. Can I handle events with different way instead of Attributes ? -------- Edited December 9, 2018 by enisn Link to comment Share on other sites More sharing options...
DjEnzo Posted December 29, 2018 Share Posted December 29, 2018 Try to copy and replace all your project dlls (NuGet, etc.) to the runtime folder. Link to comment Share on other sites More sharing options...
KevY Posted February 10, 2019 Share Posted February 10, 2019 (edited) Solution? EDIT: THe solution seems to be to copy Bootstrapper.dll from bridge_package.zip to NuGet package folder, aka C:\Users\KevY\.nuget\packages\gtanetwork.api\0.3.6\lib\netcoreapp2.0 Edited February 16, 2019 by KevY Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now