I have built a C# Windows application using a C# library hosted in a DLL.
Both the library and the application need to access some files which at
program installation are placed in the EXE's path; thus, I use
Directory.GetCu rrentDirectory( ) to initialize the default filenames so that
they point to the EXE's path. This happens in the constructor of some
objects (for the DLL) and in the OnLoad event of the EXE's form.
All this works fine in the development workstation (with Visual Studio .NET
and WinXP Pro), and the EXE's path (e.g. ...\MyExe\Bin\D ebug or the like) is
retrieved correctly either by the objects in the DLL or in the EXE's OnLoad;
but when I launch the program on a test machine with just Windows ME and
dotnet framework runtime only, the path returned by GetCurrentDirec tory is
just the root (C:\)! (I added a test
MessageBox.Show (Directory.GetC urrentDirectory ()) instruction to the release
build). Is this anything I'm doing wrong, or any problem with this OS, or
what else?
Thanks to all!
Both the library and the application need to access some files which at
program installation are placed in the EXE's path; thus, I use
Directory.GetCu rrentDirectory( ) to initialize the default filenames so that
they point to the EXE's path. This happens in the constructor of some
objects (for the DLL) and in the OnLoad event of the EXE's form.
All this works fine in the development workstation (with Visual Studio .NET
and WinXP Pro), and the EXE's path (e.g. ...\MyExe\Bin\D ebug or the like) is
retrieved correctly either by the objects in the DLL or in the EXE's OnLoad;
but when I launch the program on a test machine with just Windows ME and
dotnet framework runtime only, the path returned by GetCurrentDirec tory is
just the root (C:\)! (I added a test
MessageBox.Show (Directory.GetC urrentDirectory ()) instruction to the release
build). Is this anything I'm doing wrong, or any problem with this OS, or
what else?
Thanks to all!
Comment