A last question, i've heard people saying that saving data in settings isn't so efficient as saving it in an XML. Is that true? Since saving in the settings is much easier than the XML stuff.
							
						
					Where do settings get saved once the application is running?
				
					Collapse
				
			
		
	X
- 
	
	
	
		
	
	
	
		
	
		
			
				
	
	
	
	
	
	
	
	
	
 - 
	
	
	
		
	
	
	
		
	
		
			
				
	
	
	
	
	
	
	
	
	
Cool post, arie, I didn't know that :) For those of us who don't have a ClickOnce app to test with, Andrei, can you post what the path looks like? I'm curious :D
As for your last question, honestly, I think it boils down to preference. In terms of efficiency, computers are fast these days... unless you're reading/writing to that settings structure heavily on a real time basis, you really won't have to worry about it. By the same token, it's not terribly difficult to write your own settings storage mechanism. So if you're comfortable with the built in settings stuff and performance isn't an issue, I'd say stick with it.
If performance is an issue, do some tests. Do some performance scenarios and check the timings with a performance timer, such as a Stopwatch which lives in System.Diagnost ics. You can instantiate one, then start it. Now do your test, then stop it and check the elapsed time. Then do the same with your own stuff and compare.
Keep in mind that neither of these storage mechanisms need to access the file system on a regular basis, only on program start and close, as that's when the settings need to persist. I'm not sure what the Microsoft mechanism has, but some people might include a timed save in their own to ensure values are not lost if the program crashes, but for the most part, the values will change in-memory.Comment
 - 
	
	
	
		
	
	
	
		
	
		
			
				
	
	
	
	
	
	
	
	
	
Well my application when i debug it has this configuration path:
C:\Users\[my user name]\AppData\Local\ Microsoft\MainF rame.vshost.exe _StrongName_qkl lcxzawdnpexuhgv do4141qzecd3sw\ 1.0.0.0\user.co nfig
When i publish and install it its here:
C:\Users\[my user name]\AppData\Local\ Apps\2.0\Data\X ZZMY5EO.68H\ZGP B4VPK.09L\main. .tion_2f092bac0 42a4cc2_0001.00 00_adb1741db8a6 d54b\Data\1.0.0 .0\user.config
(the last part changes slightly if i publish again and install a newer version -even if i don't change anything inside it-)
And yea...i'll have to think about what to use, i need to save my data so that when new versions of the program can appear, the user wont lose his data when updating the program (mainly was thinking of making an uninstall button that will save the SavedData file somewhere safe, then uninstalls the program after which the user installs the new version and i put a load path button to let the user indicate where the SavedData file is stored - i know theres an updating feature in visual studio but it seems too complicated for me at the moment- )Comment
 - 
	
	
	
		
	
	
	
		
	
		
			
				
	
	
	
	
	
	
	
	
	
Ah ok, cool, thanks for posting where it is :)
ClickOnce does indeed have an update feature. If it detects a new version on the client, depending on your settings, it will either automatically give them the new version or ask them if they want to upgrade. I think anyway. If your settings file keeps track of a version, on load you can always compare the current version with the one stored in the settings file, then manipulate the data as required to bring it forward.
ClickOnce has a version number (on the Publish tab of your project's settings) that will increment with each publish. You can use the following code to get the version number...
Code:Version myVersion; if (ApplicationDeployment.IsNetworkDeployed) { myVersion = ApplicationDeployment.CurrentDeployment.CurrentVersion; } else { // you probably ran this from your debug, or directly from the binaries. The version number will be from the project settings here but not the publish tab. It'll likely be 1.0.0.0 if you haven't changed it. }Comment
 - 
	
	
	
		
	
	
	
		
	
		
			
				
	
	
	
	
	
	
	
	
	
Hmmm but how does ClickOnce update the application? Does it uninstall the old one and install the new one? Or can it just replace some files without uninstalling anything?Comment
 - 
	
	
	
		
	
	
	
		
	
		
			
				
	
	
	
	
	
	
	
	
	
:O
I must learn how! I've read a lot about it but every "guide" was really complicated, they said first i must make an xml with the version, then compare the 2 versions (the new one and the old one) and if bla then bla, if not then....ugh, i kinda stopped there since there were a few pages. Do you know any cleaner solutions?Comment
 - 
	
	
	
		
	
	
	
		
	
		
			
				
	
	
	
	
	
	
	
	
	
I need to upload it on the net first, and i don't know exactly what to upload, the WHOLE source? Neither do i know how to upload it, as in, most uploading sites give you the site where if clicked you automatically start the downloading process.Comment
 - 
	
	
	
		
	
	
	
		
	
		
			
				
	
	
	
	
	
	
	
	
	
When you click the publish button on the publish tab, it will generate files. This is what you put on your server. The user will run the .application file and it will deploy to their machine. You also have to put the site/folder it deploys from in the publish information.Comment
 
Comment