Common MultiThreading Compiler Error
Apr
14
Written by:
4/14/2008
To prefix this, we often run into instances in ASP.Net Programing, when we need to spawn a new thread to take care of some business while the original thread can continue serving the UI to the end user.
This is normally not too complicated of a task, but when you don't use a specific methodology, some of its quirks or requirements can be forgotten. For instance, I could not for the life of me get a new thread to compile. I kept verifying with previously written code that I was doing it right. And sure enough... I was! Yet I was still getting an error like this:
No accessible method '[METHODNAME]' matches the signature of delegate 'Delegate Sub ParameterizedThreadStart(obj As Object)'.
I kept pouring my eyes over the code. Something MUST be different, but what? Well, eventually, the train came tumbling in, and squished all of the blinding thoughts out and I was able to see clearly again. I was calling a Function in the new thread statement, and not a Sub. Duh!
Everything compiled and ran just fine after I changed the method to a Sub.
Strangely enough, I was not able to find any help when searching for it on Google. All of the SERPs were for other situations where multithreading was not involved.