code_junkie

Trying to load an app through reflection and get error “Could not load file or assembly…The system cannot find the file specified.”

Nov 12th, 2011
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. string myDll = string.Empty;
  2. string location = Assembly.GetExecutingAssembly().Location;
  3. if (location != null)
  4. {
  5. myDll = string.Format(@"{0}my.assembly.name.dll", location.Substring(0, location.LastIndexOf(@"")));
  6. }
Add Comment
Please, Sign In to add comment