What is CS0119?


When trying to enter play mode, I am receiving the error below:

error CS0119: Expression denotes a `___' where a `___', `___' or `___' 
was expected


The CS0119 error is caused when a new type is created using a constructor in an incorrect way.

In this example we are trying to create a new variable of type RectTransform.

Here is how the error appears in this example:

error CS0119: Expression denotes a `type' where a `variable',`value' or `method group' was expected


When using C# you need to use the new keyword in front of all constructors. Constructors are like functions that are used to create new objects (or scructs). They always have the same name as the type of object you are creating.

More Information


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Please sign in to leave a comment.