locked
C# error no extension method Task_0 RRS feed

  • Question

  •        public Class107()
            {
                this.Tasks_0 = new Tasks(new Action(this.method_0));
                this.Tasks_0.Start();
            }

    error no extension method Task_0

    Could someone help me figure out what went wrong here?

    Wednesday, March 21, 2012 12:00 AM

Answers

  •         private task task_0;  // No "s".
    
            public Class107()
            {
                this.task_0 = new Task(new Action(this.method_0));  // Still no "s".
                this.task_0.Start();
            }

    • Proposed as answer by Lie You Thursday, March 22, 2012 7:37 AM
    • Marked as answer by Lie You Tuesday, March 27, 2012 3:03 AM
    Wednesday, March 21, 2012 1:13 AM
  • Sorry, that first line should have had a capital "T" of course.

            private Task task_0;  // No "s".

    • Proposed as answer by Louis.fr Wednesday, March 21, 2012 10:02 AM
    • Marked as answer by Lie You Tuesday, March 27, 2012 3:03 AM
    Wednesday, March 21, 2012 1:19 AM

All replies

  • Check here about properly using Tasks.

    Hope it helps.


    Mitja

    Wednesday, March 21, 2012 12:21 AM
  • Is that a typo, or do you really have a class called Tasks (with an "s" on the end, as opposed to the .NET class Task)? Could you be confusing the two?
    Wednesday, March 21, 2012 12:58 AM
  • Is that a typo, or do you really have a class called Tasks (with an "s" on the end, as opposed to the .NET class Task)? Could you be confusing the two?

    yah it was a typo i sorted it out 

            private tasks task_0;
    
            public Class107()
            {
                this.task_0 = (new Action(this.method_0));
                this.task_0.Start();
            }
    But now im getting a blue underline on the Private tasks

    Wednesday, March 21, 2012 1:09 AM
  •         private task task_0;  // No "s".
    
            public Class107()
            {
                this.task_0 = new Task(new Action(this.method_0));  // Still no "s".
                this.task_0.Start();
            }

    • Proposed as answer by Lie You Thursday, March 22, 2012 7:37 AM
    • Marked as answer by Lie You Tuesday, March 27, 2012 3:03 AM
    Wednesday, March 21, 2012 1:13 AM
  • Sorry, that first line should have had a capital "T" of course.

            private Task task_0;  // No "s".

    • Proposed as answer by Louis.fr Wednesday, March 21, 2012 10:02 AM
    • Marked as answer by Lie You Tuesday, March 27, 2012 3:03 AM
    Wednesday, March 21, 2012 1:19 AM