The RelativeSearchPath of the AppDomain will contain the directory of the dll.
You cannot get the directory of the source code because that may not exist at runtime...after deploying.
namespace ClassLibrary1
{
public class Class1
{
public void MyFunction()
{
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.RelativeSearchPath;
}