The text of this article is not in this database — only its details are. Read it on the old site: BaseDirectory vs CurrentDirectory in C#
2 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: BaseDirectory vs CurrentDirectory in C#
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
Sunny SharmaPosted Sep 19, 2013, 10:41 PM
@Sam Hobbs: thanks for adding value to this post Sir!
Sam HobbsPosted Sep 19, 2013, 5:02 PM
I am nearly certain that CurrentDirectory is the same as (uses) the Windows API function GetCurrentDirectory and corresponds to the command-prompt command chdir (when used to show the current directory). It is the default location to search for files but not DLL files to be executed. I am not sure what the BaseDirectory corresponds to in the Windows API, if anything. Note that it specifies a default location for assemblies. In unmanaged code DLL files are essentially the same thing as assemblies in managed code. So perhaps the difference between CurrentDirectory and BaseDirectory is that CurrentDirectory is the default for non-execuable files and BaseDirectory is for assemblies.