1. Home
  2. Knowledge Base
  3. No Application.StartupPath in .NET CF! There is a solution though…

No Application.StartupPath in .NET CF! There is a solution though…

Too bad there is no straight-forward way in .net CF for an application to determine its folder path from where it was launched. But following code works just fine.

string assembly = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
string currentFolderPath = System.IO.Path.GetDirectoryName(assembly);

For more details on our products, click here 
If you need further assistance, please submit a ticket here

Was this helpful?
YesNo
Updated on June 2021