How to get the current directory on a class library?
This should work -
string assemblyFile = (
new System.Uri(Assembly.GetExecutingAssembly().CodeBase)
).AbsolutePath;
The below code worked for me to get the physical path of the Images folder in-class library file.
string fullFilePath = Path.Combine((new System.Uri(Assembly.GetExecutingAssembly().CodeBase)).AbsolutePath.Split(new string[] { "/bin" }, StringSplitOptions.None)[0]
, "@/Images/test.png");
I hope, it will help someone.