Application.persistentDataPath Doesn't exist in my project

I have been working on a project that uses screenshots, and to store those screenshots i used Application.persistentDataPath, Unity did not recognize it.

So i copy and pasted it into a brand new project on a MonoBehaviour script just like the other one and it worked. I have tried changing object and making new scripts but unity just doesn’t recognize "Application.persistentDataPath" and states that Application doesn’t contain persistentDataPath

I did write it correctly and even copied it from the unity doc. I believe the error is in the project itself, Anyone have a solution please?