How to get Directory while running unit test

I would do it differently.

I suggest making that file part of the solution/project. Then right-click -> Properties -> Copy To Output = Copy Always.

That file will then be copied to whatever your output directory is (e.g. C:\Source\MyProject.Test\bin\Debug).

Edit: Copy To Output = Copy if Newer is the better option

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)