Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Howdy everyone:

1. I am using VB2010
2. I have a button on a form without any text.
3. In debug mode, the button is assigned text.
4. The assigned text is written to my.settings.btnText
5. When the application is built and the executable move to the desktop and when the applications runs, the button is assigned the my.settings.btntext.
6. However, the my.settings.btntext still has an empty string.
7. I then added an settings1.settings to the project and tried the same procedure with the same results.
Does anyone know how I can save the button text created in debug mode for use in an executable. I know the easy way is to assigned the new text to my.settings but for my situation this is not the way to do it because the source code is going to be imported into other developers application and they each may have different text for the button. Also, I am trying not to write the strings to a file.

Thanks for looking at this guys.

What I have tried:

The problem contains what I have tried.
Updated 24-Sep-22 8:01am

1 solution

The problem is that - rightly - debug and release configurations (including the settings file) are completely independent. If they weren't, then there would be a high risk of dev builds accessing production databases for example - which could be disastrous for the whole company.

There are ways round this, but they mean you handling the settings data yourself instead of relying on a settings file: Where Should I Store My Data?[^] That way, you can load / save the data and both dev and prod can access it.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900