Skip to content

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

Dic 16, 2009 | 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…

Subscribe for our free newsletter

Thank you! you are successfully subscribed.
newsletter

Exclusive News and Updates on Enterprise Mobility!

* I consent to receive newsletters via email from 42Gears and its Affiliates.
Please agree
* I have reviewed and agreed to 42Gears Privacy Policy and Terms of Use prior to subscribing and understand that I may change my preference or unsubscribe at any time.
Please agree
Please verify captcha
Please enter a valid official email