有的时候,当前执行的DLL 和启动的EXE 所在路径并不一致,这时我们想要获得当前执行DLL 所在路径可以使用下面的方法. // Summary: // Gets the path or UNC location of the loaded file that contains the manifest. // // Returns: // The location of the loaded file that contains the manifest. If the loaded file
1:在工程目录增加dll目录,然后将dll文件复制到此目录,例如: 2:增加引用,定位到工程的dll目录,选中要增加的dll文件 3:修改dll文件夹下面的dll文件属性 选中嵌入式资源,不复制. 4:增加dll加载代码 static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { A