c# - How to get current physical path of a reflected assembly -


i have executable loads class library dll using reflection. within class library, want find out physical path of class library is. don't want executing assembly, original executable.

eg exe might in c:\program\ , class library might c:\libraries\remote\assembly1.dll

within method inside assembly1.dll need call returns me

c:\libraries\remote\

i have tried

  var currentlocation = assembly.getassembly(gettype()).location; 

but doesn't seem work. how can this?

i use way current class's assembly path:

var dllpath = new uri(this.gettype().assembly.getname().codebase).localpath; 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -