Sunday 24 March 2013

Get Bin Directory Path using C# for web application as well as class library

We may get the requirement while coding in C# like we need to get the bin path  of class library or Web application.

the following is the sample code which works for class library as well as web application.

string binPath = Path.GetDirectoryName((new System.Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath)

No comments:

Post a Comment