Search code examples
c#compact-frameworkwindows-mobile-6

Get file path of the current class library in Windows Mobile 6 CE from the solution


I'm trying to retrieve the current path of a file from a project in windows mobile 6 application. I've tried using

System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase; 

This doesn't retrieve the file path I'm looking for as the file I'm calling is in a different Class library of the solution. Can anyone help me out in retrieving the file path for the class library of the solution which isn't the executing assembly.

Thanks, Vinod.


Solution

  • You can use typeof(SomeType).Assembly.GetName().CodeBase, where SomeType is any type in the desired DLL.