Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Task does not contain a definition for 'Run'

Discussion in 'Scripting' started by mahdi71, Apr 15, 2023.

  1. mahdi71

    mahdi71

    Joined:
    Feb 27, 2019
    Posts:
    4
    Hi, i'm using unity 2021.3.22f1
    and i'm getting this error :
    error CS0117: 'Task' does not contain a definition for 'Run'
    __
    unity doesn't let us change the .net version anymore, but shouldn't it already use the .net version that support this ?
    also i need to mention that i upgraded my project to this version of unity from an older version like 2018
     
  2. samana1407

    samana1407

    Joined:
    Aug 23, 2015
    Posts:
    76
    Maybe you already have another user class in the project named Task?
     
    Yoreki, mahdi71 and Bunny83 like this.
  3. Bunny83

    Bunny83

    Joined:
    Oct 18, 2010
    Posts:
    3,571
    Yes, most likely. The error usually contains the full class name including the namespace. "If" the error is actually what he posted, he most likely has another class in the global namespace called Task.
     
    mahdi71 likes this.
  4. mahdi71

    mahdi71

    Joined:
    Feb 27, 2019
    Posts:
    4
    Wow, ho did i missed that, Thanks so much, yes that was the problem
     
    Yoreki likes this.