I am doing a multi-threaded application in C# and need to pass some parameters to a thread.
Attempting to use the ParameterizedThreadStart class so that I can pass a class variable (which contains all the parameters I want to pass). However, the class seems to be unrecognised (there is a red line underneath it in the source code) and on compilation I got a “The type or namespace name ParameterizedThreadStart could not be found (are you missing a using directive or an assembly reference?)”.
I am using the following libraries from the framework:
using System;
using System.Collections;
using System.Threading;
Am I doing anything wrong? I am using VS 2003 (7.1.6030) and .NET Framework 1.1.
Thank you.
That ParameterizedThreadStart type not exists before .net framework 2.0, but you can accomplish the same goal (pass parameters to thread) creating a simple class and using good old ThreadStart delegate, like the following:
and the use will be: