I am using Visual Studio 2019 and am trying to get the name of the path of a file that is in the same folder in order to unit test.
So far I have used this code:
var directory = System.AppDomain.CurrentDomain.BaseDirectory
which I hoped would get the base directory. However it returns the correct path WITH an extra: "\bin\Debug\netcoreap2.2" at the end, which I want to remove from the path.
I have tried cleaning and rebuilding my project. I have tried deleting the files from the bin folder. However this does not work.
Does anyone know the solution for this please?