简体   繁体   中英

TargetParameterCountException on Application.Exit

I am trying to close my C# Form application from a different thread than the main thread. I always get this error: 'System.Reflection.TargetParameterCountException' occurred in mscorlib.dll on the main line in Program.cs:

Application.Run(new Im_SecurityCenter(args));

I have tried doing it through this.BeginInvoke(ShutdownDelegate) and also using a dispatcher, but always the same error.

The exception indicates a problem with the Invoke call.

Use the Threads window to find the true source of the Exception. The cited line is not the source.

Ensure that the late-bound method being invoked has the same number of parameters as you are passing in your .Invoke

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM