M
moondaddy
I have a sample vb .net 2.0 winforms app and am using Oneclick deployment to
a remote server. All of the files (DLLs, EXEs, manifests, configs, etc.)
seem to get deployed to the target folder on the client OK and seem to work
OK, Except for some additional files I created for the client application.
For example, I have a file called myData.xml and myCustomConfix.xml which
the windows app uses. In the old 1.1 days (while working in the VS2003 IDE)
I put these files in the bin folder and the app would reference and use them
via a line of code like this:
Dim sMyDataFile As String = Directory.GetCurrentDirectory & "/myData.xml"
Dim sMyConfigFile As String = Directory.GetCurrentDirectory &
"/myCustomConfix.xml"
and sMyDataFile would be something like this:
"biglongpath/projectfolder/bin/myData.xml"
Then when I create an installation exe for the app and install it on the
client, all files (dlls, app files, myData.xml, and myCustomConfix.xml) are
all located in the in one single target folder on the client.
Now in .net .2.0 the path for:
Dim sMyDataFile As String = Directory.GetCurrentDirectory & "/myData.xml"
is:
"biglongpath/projectfolder/bin/Debug/myData.xml" (now in the bin/debug
folder)
and when oneclick installs in to the client all the files are installed
together under a single folder except for myData.xml and myCustomConfix.xml
which get installed in the bin/debug folder on the client.
The problem is the app still uses the same code to find those files
(Directory.GetCurrentDirectory & "/myData.xml" ) but this path resolves to
the main folder where the app exe is running and not the bin/debug folder.
Questions:
1) This seems to be a major functionality by design (how/where things run
from in the ide vs how/where the run on the client) Why isn't this better
documented on how to deal with this. I'm sure this is a common problem.
2) What is the proper way to deal with this?
Thanks.
a remote server. All of the files (DLLs, EXEs, manifests, configs, etc.)
seem to get deployed to the target folder on the client OK and seem to work
OK, Except for some additional files I created for the client application.
For example, I have a file called myData.xml and myCustomConfix.xml which
the windows app uses. In the old 1.1 days (while working in the VS2003 IDE)
I put these files in the bin folder and the app would reference and use them
via a line of code like this:
Dim sMyDataFile As String = Directory.GetCurrentDirectory & "/myData.xml"
Dim sMyConfigFile As String = Directory.GetCurrentDirectory &
"/myCustomConfix.xml"
and sMyDataFile would be something like this:
"biglongpath/projectfolder/bin/myData.xml"
Then when I create an installation exe for the app and install it on the
client, all files (dlls, app files, myData.xml, and myCustomConfix.xml) are
all located in the in one single target folder on the client.
Now in .net .2.0 the path for:
Dim sMyDataFile As String = Directory.GetCurrentDirectory & "/myData.xml"
is:
"biglongpath/projectfolder/bin/Debug/myData.xml" (now in the bin/debug
folder)
and when oneclick installs in to the client all the files are installed
together under a single folder except for myData.xml and myCustomConfix.xml
which get installed in the bin/debug folder on the client.
The problem is the app still uses the same code to find those files
(Directory.GetCurrentDirectory & "/myData.xml" ) but this path resolves to
the main folder where the app exe is running and not the bin/debug folder.
Questions:
1) This seems to be a major functionality by design (how/where things run
from in the ide vs how/where the run on the client) Why isn't this better
documented on how to deal with this. I'm sure this is a common problem.
2) What is the proper way to deal with this?
Thanks.