如何访问 dll 文件夹中的文件而不是可执行文件?

How to access a file in the dll's folder instead of the executable?

我有一个使用 dll 的可执行文件(它们位于 2 个不同的文件夹中)。 当我在 dll 中的一种方法中执行 System.IO.Directory.GetCurrentDirectory() 时,我得到了可执行文件夹。有没有办法获取dll文件夹?

使用 Assembly.GetExecutingAssembly().Location 获取 DLL 的完整路径。