jeudi 25 juin 2015

Get physical file path in unit test running in a domain instead a relative path to the domain

How can I get a physical file instead a domain related path in my unit test?

I am using this code :

 var codebase = Assembly.GetExecutingAssembly().CodeBase;
 var pathUrlToDllDirectory = Path.GetDirectoryName(codebase);
 var pathToDllDirectory = new Uri(pathUrlToDllDirectory).LocalPath;

What I get is this

file:\compdata\folders$\userA\Documents\Projects\ProjectA\ProjectA.Test\bin\Debug

But I what I expected is somthing like this:

C:\windows\userA\Documents\Projects\ProjectA\ProjectA.Test\bin\Debug

Aucun commentaire:

Enregistrer un commentaire