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

By 42Gears Team

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);


Enjoy...

“Written with expertise and passion to help you understand the topic better.”

4
42Gears Team – Content Author
Published on December 16, 2009

Subscribe to our newsletter

Stay updated with the latest news, articles, and resources on enterprise mobility.

Weekly articles
Actionable insights delivered once a week. No noise.
No spam
Your privacy matters. Unsubscribe anytime.