Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

One click

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cdude - 28 Feb 2008 07:02 GMT
I want to use one click to deploy my windows application but i want to
include a xml file in which i can change the connectionstring. How can
i do this. When you install the actual application where does it
install the .exe file and is there a setting where i can set where i
want the files to be installed to.
Marc Gravell - 28 Feb 2008 09:43 GMT
The files go to a private folder somewhere under the user's app-data
(IIRC) - but you shouldn't be messing with that with ClickOnce; not least
because if you edit any of the files the system will detect the hash
difference and will refuse to run. It doesn't trust anybody.

I think, however, that your requirements can be better met by using the
settings logic built into the runtime (and IDE); just mark your connection
string setting as a user-setting (in the settings designer), and it will be
saved/loaded to/from the correct place in the user's profile.

Marc
RobinS - 06 Mar 2008 06:08 GMT
Add the XML to your project, and mark the Build Action to "Content", and the
"copy to..." as "Copy Always".

If you add it right under the project, it will be copied to the same folder
as the .exe. If you put it in a folder under the project, it will be copied
to a folder with the same name relative to the .exe. Does that make sense?

Then in the ApplicationFiles page under the Publish tab, make sure it is NOT
marked as a data file, or you have to go look in the ApplicationData folder
for it.

To find it at run time, look in
System.Windows.Forms.Application.StartupPath, and if it's not in the same
folder as the exe, append the rest of the relative path.

One huge caveat: Putting a connection string on someone's computer, even in
an obfuscated ClickOnce folder name, and not encrypting it, is not a great
idea. If it has the user name and password in it, it's a horrible idea. You
should embed it into the application or encrypt the xml file where you are
storing it.

RobinS.
GoldMail, Inc.
---------------------------------
>I want to use one click to deploy my windows application but i want to
> include a xml file in which i can change the connectionstring. How can
> i do this. When you install the actual application where does it
> install the .exe file and is there a setting where i can set where i
> want the files to be installed to.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.