According to the MSDN, the BaseDirectory is where an AppDomain will look for DLLs to load, while ExecutablePath will provide the path to the original executable file (including file name). I know that one has the file name and the other does not. I know that if I create a new AppDomain I can give it a different path. But removing the file name from ExecutablePath and assuming I'm only using one AppDomain, in practice, what is the difference between those two paths? Will they always be the same (again, assuming only one AppDomain)? Is there an instance when they would be different?
AppDomain. CurrentDomain. BaseDirectory returns the directory from where the current application domain was loaded.
The base directory is the path on your system that corresponds to the path where your application will be installed.
Think of something like ASP.NET where your code is hosted inside another process. The BaseDirectory is going to be where your code lives, but the ExecutablePath is probably some dll in system32.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With