0

I'm looking for a way to return my assembly location at runtime, I can't use Assembly.Location because it returns the shadow-copied assembly's path when running under NUnit.

1 Answers1

3

Use CodeBase property instead, it return the original dll location rather than the shadow copied dll location.

For example:

Assembly assembly = GetType().Assembly;    
Uri codeBaseUri = new Uri(assembly.CodeBase);
string path = codeBaseUri.LocalPath;