I'm trying to execute a tool-exe which is located in the same directory as main exe. For this I'm trying to obtain first the exe-name of the process using Assembly.GetExecutingAssembly and then getting the directory using IO.Path.GetDirectoryName
//1
String exePath = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
//2
String ncpath = System.IO.Path.GetDirectoryName(exePath);
1 returns "file:///C:/Development/RC_trunk/bin/Release/ResultConfirmation.EXE" It is an URI. Not exactly what I need but ok.
2 returns "file:\C:\Development\RC_trunk\bin\Release" Which seems to be a simple [/]+ to \ replacement.
Am I using wrong API for my problem?
P.S. IDE is VS2008