|
-
Jan 31st, 2011, 04:32 PM
#1
Thread Starter
Member
App.config Setup and Deployment
Can anyone guide me on how to setup my deployment project so that users can customize thier own settings in app.config? Which special folder in the File System browser should I add, Personal Data, Application Data, or Programs Menu? How do I add the app.config to the folder? What about the project output, should it also be in the same folder? If so, should the project output be taken out of the Application Folder, in other words, exist in one place? I tested my deployment and was shocked that the icon only opened on the test user's pc after installation. I have custom settings in the app.config file that have default values, but must be configurable for user specific settings. Please, any help is really appreciated. I've been searching the web to no avail for a solution. Thanks.
-
Jan 31st, 2011, 06:27 PM
#2
Re: App.config Setup and Deployment
The primary config file goes in the same folder as the application. That's it, that's all. If you add User-scoped settings, their default values will be stored in the primary config file but they can be edited and saved at run time. The current values for User-scoped settings are automatically stored in a user-specific config file under each user's personal folder.
When I talk about settings, whether User- or Application-scoped, I'm talking about adding them on the Settings page of the project properties and accessing them in code via My.Settings. Only User-scoped settings are editable at run time via My.Settings.
If you want behaviour other than the default then you can either implement your own settings provider (which I've never done) or just use your own mechanism, like store your own text or XML files somewhere.
-
Feb 1st, 2011, 02:32 PM
#3
Thread Starter
Member
Re: App.config Setup and Deployment
Forgive me for still being a little confused by your explaination. I have my project setup with appSettings which need to be changed, and retained by the user. I tested this functionality and it works for me. However, when installing my project on another users pc, it doesn't run. That configuration consisted of the primary output being in the Application Folder, and shortcuts in the Programs Menu, Personal Data Folder, and Application Data Folder. I guess I need to know where to place the project output and shortcuts so the project runs under the users profile...Vista users btw...and how to place the app.config file in a location that is accessible, and will allow edits. Thanks.
-
Feb 1st, 2011, 05:37 PM
#4
Re: App.config Setup and Deployment
You don't have to do anything. Add your settings with User scope on the Settings page of the project properties. That's it, that's all. The rest is done for you. Like I said, the default value for User-scoped settings is stored in the primary config file, which is stored in the same folder as the EXE. You don't have to do anything to make that happen. The config file is part of the project primary output, along with the EXE. When the app runs, a copy of the User-scoped settings is stored under the current user's personal folder. All User-scoped settings are loaded from and saved to that user config file. You don't have to do anything to make that happen.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|