Closed
Description
Your method of determining the assembly path is not working all the time. An example is: If you have a # sign in your path, it will get stripped off by the Uri:
string codeBase = Assembly.GetExecutingAssembly().CodeBase; // "file://D:/Dev/C#/Projects/../../Test.exe"
string originalAssemblypath = new Uri(codeBase).LocalPath; // "D:\Dev\C"
You should use this method of getting the location:
string originalAssemblypath = new FileInfo(Assembly.GetExecutingAssembly().Location).DirectoryName
The location attribute stores a more system friendly path to the running executable.
Metadata
Metadata
Assignees
Labels
No labels