I have downloaded one ASP.Net Core 2.2 MVC project. It is running fine. But when I created new Asp.Net core 2.2 MVC project in my system and copied all code from downloaded project one GetCurrentDirectory function is not working properly.
I am using below code :
Path.Combine(Directory.GetCurrentDirectory(), location, fileName)
My project is in D drive. The project which I downloaded is showing correct path. But the project I created is showing below path :
C:\Program Files\IIS Express\data\people.json
Can any one help me in explaining why is this happening?