Re: Application.startuppath
Did you print Application.StartupPath to confirm that it infact is: "C:\CodeRed6" ?
Re: Application.startuppath
Is the return type for ExeConfigFilename as string?
If it is, try
fileMap.ExeConfigFilename = ".\CodeRed6\CodeRed_1_0_0_10\CodeRed.exe.config.deploy"
Re: Application.startuppath
Surely Application.StartupPath will be returning "C:\CodeRed6\CodeRed_1_0_0_10".
Re: Application.startuppath
According your code I assume your exe is on the
C:\
if that's true application.startuppath returns you c:\
so your path is
c:\\CodeRed6\CodeRed_1_0_0_10\CodeRed.exe.config.deploy
which returns you an error
Try that
VB Code:
If not Application.StartupPath.EndsWith("\") Then
fileMap.ExeConfigFilename = Application.StartupPath & "\"
End If
fileMap.ExeConfigFilename &= "CodeRed6\CodeRed_1_0_0_10\CodeRed.exe.config.deploy"
Hope this helps
Re: Application.startuppath
JMC has given you the right answer. You need to just append it with the string of your file name.
Disregard what i wrote earlier.
Re: Application.startuppath
Hi again
As usual JMC points on the right direction :D
Just check this tread (or have a look on the help) to know what is returning the startuppath method and concatenate the right string to get the path (or file) relative to startuppath of you application
Re: Application.startuppath [*Resolved *]
Hello,
I thought I had this resolved.
The problem is this. I have deployed a program in the folder where the setup file is, I have a folder called CodeRed_1_0_0_10, inside that folder I have a file called CodeRed.exe.config.deploy. I want to be able to access this file.
The path is this:
C:\Deployed_4_10_06\CodeRed_1_0_0_10.
The setup.exe file is located in the Deployed_4_10_06 folder. I thought by using application.startuppath would point to this directory. However, after checking I found out that is points to this one below:
C:\Documents and Settings\yasin\Local Settings\Apps\2.0\YDBGO2AL.YA3\TOMO6HER.GJR\code..tion_53e3de40adb22891_0001.0000_adfb41cfb825f353
I thought by using this:
path = Application.StartupPath & "\CodeRed_1_0_0_11\" & "CodeRed.exe.config.deploy"
I would be able to update my file, but cannot not.
Is there a way to be able to point to the file where the setup.exe is located?
Many thanks in advance,
Steve
Re: Application.startuppath
It looks very much like you're publishing your app using ClickOnce. One of the advantages of ClickOnce is that it has in-built auto-update functionality. You should head to MSDN and read up on ClickOnce and what it can and can't do.