VS 2008 Nested Settings In Config File?
Apr 18, 2012
I am writing an application that will be used to extract information from any one of three different database applications, depending on the option selected. I would also like it to be possible to run it against one of several environments (e.g. development, test or live).
I plan to hold the relevant logon details (in encrypted form, of course) in the app.config file, with the appropriate details selected depending on the environment and application. Rather than have each option hard-coded into a Select Case statement, I want to be able to nest the variables in the app.config. I had envisaged a section of the config file looking like this:
[Code]...
View 7 Replies
ADVERTISEMENT
Oct 30, 2009
I have created a settings-file for my plug-in-based app. When the mainApp writes the settings to the file, the pluginApp should read the settings from the settings-file (when opening or at runtime even better), but somehow it reads the settings from the app.config-file. This means that the pluginApp never will read the settings according the values of the file.
View 4 Replies
Jul 16, 2009
I know that when using my.settings that when I exit my app that it saves them and then next reload it imports my.settings back.
My question, is there a way to create this user.config file on the apps first load?
View 3 Replies
Jan 3, 2010
I'm looking for a way to specify the location for the User.config file that is used for storing the My.Settings object. It appears that this is not possible. The problem for me is, I don't want to be responsible for creating several different files on the users computer that really have no use and are difficult to find and clean once an update is released. For most users, this is not a serious problem, as many will probably never update the software, and most will probably only go through a couple of updates. On my system, there are config files for every build of the application, and the same to a lesser extent will be true for my beta testers.
I can understand that MS wants to make sure that no two applications will use the same location for storing application data, but a simple [UserData] [CompanyName][ApplicationName] for storing application data will probably suffice for 99.9999 percent of the legitimate applications in the world. Bogging a user's system down with erroneous files, no matter how small, is an unnecessary drain on system resources and a potential source of problems for the user. It's bad enough that most programs leave bits and pieces of themselves all over a user's system after De-installation - this to me seems only to exaggerate this problem.
Is the only way to get around this problem to write a whole new Settings Class? Is there a way to change the location of the UserConfig file to a more friendly (and more predictable) location that I am not finding for myself? It would seem that having at least the OPTION to specify a location for the User.Config file would be OBVIOUS and easy to implement, so why did they leave this out?
View 5 Replies
Aug 18, 2010
I'm trying to use the following command:
Dim xmlFilePath As String = _
System.Configuration.ConfigurationManager.AppSettings("XmlFilePath")
to retrieve the following setting:
<applicationSettings>
<MySolution.WebProject.My.MySettings>
<setting name="XmlFilePath" serializeAs="String">
[Code]....
However, xmlFilePath shows up as Nothing after that line of code is run.
What's the correct code to get a setting out of the web.config file in an ASP.NET application?
NOTE: Although you can add keys individually to the <appsettings> tag, I'm trying to figure out how to use it with the "Settings" tab in the project's properties.
View 2 Replies
Mar 10, 2009
I have been searching and posting regarding this problem and have found nothing to aid me. Discussion is either on web.config files or deal only with external files for connection strings or earlier versions of vb.net not 2008.I have already successfully put connection strings into an external config file, but trying the same approach with application settings has failed.There are two sections of the app.config involved with application settings.
1. the configuration and config sections at the top of the config. file where the section group and the section name are described.
2. the actually data for the application settings by section group section name which appears in the body of the configuraton section of the app.config.[code]
View 5 Replies
Nov 29, 2009
I would like to tweak some of the numbers in the app.exe.config file while the program is running. I would like my program to re-load those valued from the edited txt file.
I have tried my.settings.reset, reload, and upgrade. None of these seem to reload the values from the config file into the program
vs 2005
vb.net
How can i get my program to re-read the config file into its memory once it is up and running. say when a button is clicked?
View 4 Replies
Mar 6, 2011
After reading through a bunch of stuff, I was curious what production developers use for config files. I know that there is an app.config file that can be modified by the user of the program w/ settings. I also know I can create my own .xml file or .ini file to store settings as well. I wanted to know from the production side, what do you use and why?
View 1 Replies
Sep 14, 2010
Is there a simple way to read from the global application.exe.config file from a dll?urrently I am loading the file as an XmlDocument but I wonder if there is a better solution.That's what I mean:If I create a new WinForms Project I have a Settings Tab in the Project properties where I can add some simple values (And I want to access the per Application settings, not the user beased ones).From my code I can access these values with:
Console.WriteLine(Properties.Settings.Default.SomeValue);
The Settings class is autogenerated in the file Settings.Designer.cs.Now I have the case where a dll need's to read the settings from the Main Application's config file. Is there a simple way to achive this? Currently I am reading the file as an XML Document.
View 2 Replies
May 18, 2009
I am just not happy with the fact that the user.config file gtets saved in the user's account folder. Is there a way to save it in the Application's Startup Folder instead? I couldn't find any configuration properties within the PROJECT PROPERTIES which would let me change the file location.
View 2 Replies
Mar 23, 2011
Is there a really simple way to save the app.config file to a location then load it again? I'm making a multiclient app. I was planning on having each user have a folder, and in that folder would be their personalized app.config file that would load when they log in. I don't really know any XML.
View 13 Replies
Mar 26, 2009
I have a class library (Named ADI), that needs some configuration settings from the project using it (like connectionstring, filesystem locations etc).
I want to define these settings in my Windows Forms/Web Projects App.Config or Web.Config, like other settings.
Here is part of my app.config for my windows forms application:
<applicationSettings>
<PhotoImportRobot.My.MySettings>
<setting name="ADIImageRoot" serializeAs="String">
[Code]....
View 3 Replies
Dec 19, 2011
I recently changed application settings to be in an encrypted config file.The first time I run any application and try to retrieve a setting (My.settings. ...) from the config file I get an Unrecognized attribute 'configProtectionProvider'If I restart the application I don't get an error due to the fact that it doesn't re-encrypt during that run. Why when I run the application for the first time am I getting this error?
I am encrypting the config file on application startup using the following code:
[Code]...
View 1 Replies
Aug 7, 2009
in vb.net i am trying to save application settings but for USER but i cannot find the user.config file
when does this file get created?
i searched my entire hardrive. i also searched the entire project.
View 2 Replies
Jul 29, 2009
Every time I compile my app and the version number changes (I have an auto-incrementing build number), I lose the user-configured app.config settings, since they're stored in the AppData folder for a specific version. Essentially, every release of my application starts from scratch as far as user settings go.
While this is a mild annoyance in development, it raises the question as I approach deployment/release - if I use the app.config to store my user settings, will the user's personalized settings be hosed every time they install a patch that changes the version number of my app? If so, is there an easy way to "upgrade" the settings from the previous release? I know that using HKCU in the registry is another option, but I like the ease of the My.Settings namespace, and I'd like to stay with app.config.
View 2 Replies
Aug 5, 2009
I saw that you can also use a "Settings File" (Add new Item)to add your settings instead of the application settings. But I can't seem to write any values to the file. Someone with experience with the "Settings1.settings"?
View 2 Replies
Nov 23, 2010
A Windows service written in VB.NET is using the My.Settings namespace for simplicity. There are only three settings to read, and these are read within the constructor of the ServiceLauncher.
I am attempting to install the service as such:
installutil GID.ServiceLauncher.exe
And this is successful, however the config settings it is using are not the ones within the GID.ServiceLauncher.exe.config file, instead it is using the ones baked into the app as Default Settings within Settings.Designer.vb (marked with DefaultSettingValueAttribute). [The questionable wisdom of Microsoft not allowing a developer to ignore default settings is another question entirely].
How can I further diagnose this issue, and maybe force a reload of settings? I tried calling My.Settings.Default.Reload, however this did nothing. All settings are application settings, and only differ by "value" from those in the auto generated file.
I have successfully attached the debugger using System.Diagnostics.Debugger.Launch() and true enough, the settings are still the default settings.
In anticipation of the question, the background: The reason for requiring configuration settings is because this is a very straightforward service that simply executes an exe; and this exe is in configurable location. There are other reasons also, such as I wish to have the service name configurable without recompiling.
View 3 Replies
Oct 8, 2009
I'm not a WinForms developer, but have been doing ASP.NET for quite some time.I have to write something in VB.NET that just pushes some simple data to a database.So I created the VB.NET WinForms app (Visual Studio 2005).When I run the app it works fine for using:
Dim conMyData As SqlConnection
Dim cmdInsert As SqlCommand
Dim isSaved As Boolean
[code]....
That is, if I define the connection string inside of the properties of the project. If I build my project, snatch the .exe from the bindebug folder and run it on my desktop,it works ONLY if I have the version that says My.Settings.MyConnectionString Otherwise, if I use the other version where I am pulling the connection string from my app.config file it only works if I run the project through visual studio, it will not run by just opening up the .exe on my desktop. It syas something like ConnectionString not set, or sometimes it states object not set to an instance of something... why does it work from within the project?Is it because when I build the project it cannot reference that app.config file since I've moved it to my desktop?
View 2 Replies
Dec 23, 2010
Private Sub SaveButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SaveButton.Click
Dim Config As Configuration
Dim Section As ConnectionStringsSection
[code]....
View 4 Replies
May 19, 2010
Say I have a Class Library project with its own .dll.config, and a forms application. I want to confirm that it is impossible to reference the .dll.config file from the .exe.config file and still use My.Settings.
For example: I have SomeClassLibrary project, with SomeSetting that I can access through My.Settings.SomeSetting. I also have SomeFormsApp project. This is what I want my SomeFormsApp.exe.config to look like:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
[Code].....
From my readings, this seems impossible. I either need to copy the content of SomeClassLibrary.dll.config into SomeFormsApp.exe.config, which is tedious and error prone when copying from multiple class libraries, or I need to use ConfigurationManager, which bypasses My.Settings and its typed, Intellisensed goodness.
View 9 Replies
Jun 2, 2009
I'm having trouble with my application settings and I'm wondering if anyone else has seen this.
I have a Librabry with a connection string. In the project for the library it has its own app.config:
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="OBInfrastructure.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
[Code]...
View 1 Replies
Dec 15, 2011
(My question is similar to this one, but the code is slightly different, and the solution doesn't work for me)I'm trying to save settings changes to the app.config:
Dim config As System.Configuration.Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
config.AppSettings.Settings("HistoryRootDirectoryPath").Value = p_historySavingPath
[code].....
View 1 Replies
Jan 18, 2010
is there any tool to validate configuration file?
View 1 Replies
Feb 1, 2012
I am trying to create an msi install for my windows service. The reason for creating an msi is that the intended users want to be able to quickly install the service with as-little intervention as possible.
i can get the service to install as a msi but i have a variable within my code that i need the user to define when the msi is being installed. the variable i require from the user is the file path which they want the xml files my service creates to be located.
i thought i could configure the app.config application settings to contain the file path that the xml files should be written to. However i'm struggling to do this and im not to sure if its the best way to do it?
I have my setup project that contains my executable and has my textbox which will contain the one variable from the user.I have an installer class which contains my serviceinstaller and process installer. This is where im struggling to understand what i need to do next. Do i need to override the install method? The current code of my installer class was automatically generated and is as follows:
[Code]...
View 1 Replies
Jul 14, 2011
windows services - Configure App.config Application Settings During MSI Install
View 3 Replies
Mar 21, 2010
I'm using this
[code]...
Now is the question, how can I save to the config file? Like, replace "this is the text" with the new text in textbox1.text
View 6 Replies
May 15, 2010
Can someone tell me where this is? Most places on the net say it's in same folder as the .exe, but when I look in there I don't see it. There is an .xml file in there but that doesn't look like it's it.
View 5 Replies
Apr 15, 2011
1. I can't find the file which reflects changes to user settings. This might be because I just can't find it (I can see a bunch of user.config files but they are all empty - weird!), or...
2. I'm not actually saving them when I think I am.
Regarding 2. - do I need to invoke
Is this all I need? And if so, why are my user.configs empty?
View 1 Replies
Jun 1, 2010
I have created a Outlook 2007 AddIn project with a Setup project.The settings for a databae connection are in the registry.Now I want to create a config file outside the msi so the settings for the database connection can be changed before the addin is installed.It is no problem if the settings stay in the config file instead of the registry.I have googled around but found no solution yet.
View 2 Replies
Oct 14, 2009
I have the creating INI file down, but how would I get it to read the text and then, based on the text there, make things checked/unchecked
Dim SaveFile As New StreamWriter("Settings.ini")
View 7 Replies