When I run the code the Application.StartupPath points to the folder where the .exe lives. But when I am running a unit test it points to "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform\Archive\202112 Log.txt" and, of course, crashes because the folder does not exist there. The Archive folder exists in the path ..\MyProgram\MyProgramTests\bin\Debug\. Why is it pointing there? How do I make the unit testing look in the right place for the folder?
↧