Member Avatar for humorousone

I've got a program with (you guessed it) a .properties file.

I've saved new values for properties while running the program through visual studio's debugging system.
The changed properties are persistent when running the program (they appear in text boxes, as per my code), but when I view the settings file within visual studio, they are the same as before I changed them.

Two questions here:
-Would these settings reset back to default if I were to compile and export the project?
-Will these modified settings be still viewable if I commit the project changes to github (using the visual studio gitignore)

Thanks for any responses..

Hi

Would these settings reset back to default if I were to compile and export the project?

No, but you need to be mindful in what mode you are compiling. If you test in Debug mode and modify the application settings file in the Debug/bin folder and then compile in Release mode, the file in Release/bin will be the same as the settings in the project and not that which may have been modified in Debug/bin.

Will these modified settings be still viewable if I commit the project changes to github (using the visual studio gitignore)

Yes, your settings will be persisted for both Visual Studio and any changes you may have made. Visual Studio reads the settings from the App.config file, but your program reads them from the application configuration file. So both will be available if you upload them to github.

To test, modify your application settings file in your whatever/bin folder (where whatever refers to debug or release depending on your compile settings) in Notepad and then run your program and you will see that the setting has changed, but in Visual Stido, properties it has not. Now midfy the App.config file in Notepad in the root of your project folder and you will see that Visual Studio reflects these changes.

HTH

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.