How To Put Application Settings In An External App.config File Using V

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


ADVERTISEMENT

.net - Read A Settings Value From The Web.config File In An ASP.NET Application?

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

VS 2008 Settings Are Read From App.config Instead Of Settings-file

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

Save Application Settings But For USER But Cannot Find The User.config File

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

Getting Values From External Config File?

Jan 3, 2012

i am building a web application with VS2010 and framework 4

in the web.config i have defined the external file path
<appSettings file="\serverc$InetpubwwwrootConnectionsGlobal_Settings.config">
<add key="var_1" value="xpto" />

[code].....

View 3 Replies

Class Library Getting Settings From Own App.config NOT The Application's?

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

Windows Services - Configure App.config Application Settings During MSI Install .net?

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

Windows Services - Configure App.config Application Settings During MSI Install?

Jul 14, 2011

windows services - Configure App.config Application Settings During MSI Install

View 3 Replies

C# :: Validate Dot Net Application Config File(ex, App.exe.config) On Console?

Jan 18, 2010

is there any tool to validate configuration file?

View 1 Replies

Re-load The My.settings Values From The Config File?

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

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

VS 2010 - User Settings (App Config File)

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

Way To Read Settings Of An App.exe.config File From A Linked Dll?

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

VS 2008 - My.Settings File - Specify The Location For User.config File

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

Settings Load From External File?

Feb 26, 2012

I have a project need to reset the my.settings by external files, i have problem to get back the system.drawing.color

Frist I use the SaveConfigFromMySettingToFile() to get the config file,then i add the LoadConfigFromFileToMySetting() at the FormLoad action,But Nothing change! Why? without the LoadConfigFromFileToMySetting() at system load i got the correct color of the button from my.settings.

[Code]...

View 3 Replies

Change The User Settings (*.config) File Location?

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

VS 2008 Create Settings (user.config File) On App First Run?

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

VS 2010 - Easiest Way To Save Settings To Config File?

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

Asp.net - Getting Configuration Settings From Web.config/app.config Using Class Library

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

Unrecognized Attribute 'configProtectionProvider' When Trying To Access Settings After Encryption Of Config File?

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

.net - Automatically "upgrade" User Settings From Previous Version Of App.config File?

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

C# - When/How Does My .NET Application Use It's App.Config File

Dec 31, 2011

I've never thought about it before; but I recently learned how I could modify the app.config file to add/remove trace listeners (for example, to redirect all of the Trace.WriteLine output to a text file).But I don't quite understand how it works? I know the corresponding C# code to do the same as the config (in this example) - does that code get generated/executed before my application's entry point?

View 3 Replies

Using Own Config File In Application?

Oct 23, 2011

As a practice exercise at my college we have to make a simple room booking system, complete with its own config file. We're not allowed to use the one built into VB.NET (the professor wants us to adapt to not relying on things like that) so I've made my own. This is a sample:

// Config file.
// First column is the variable name that will be used to
// reference the value in the second column. Seperate each

[code].....

View 4 Replies

C# - Location Authorization Nodes In A Web.config Be External?

Sep 20, 2010

Is it possible to have location authorization nodes in a web.config be external?

Such that I could take all of the nodes simlar to

[Code]...

And move them outside of the web.config or something simlar? I find these nodes at an extreme amount of noise to a web.config when they're relatively static. Normally my approach would be to config source something like this but since it falls under the root node I'm not sure of it's possible with these nodes.

View 1 Replies

Reading Writing To External App.config Files?

Aug 28, 2010

I need to read the keys from several external applications .config files, is it possible to specify the file for AppSettingsReader?

View 1 Replies

Config File In Window Application?

Nov 24, 2010

In my solution I have 3 project and I want to create the single config file for all project, I mean instance of creating config file for all the 3 project I am creating one config file in the solution level that serve the purpose of all the project.

Now when i am reading the config file I am writing like this , in one of the project-

System.Configuration.ConfigurationManager.AppSettings("CREATEDBY")

but this return me noting always.

App.Config file location - D:ProjectCommunico_SCEPMS Outlook Add-in

and the project location where I am to accessing the app.config file- D:ProjectCommunico_SCEPMSFileViewEPMSFileView

This is my config file

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>

[Code]....

View 2 Replies

Secure App.config File In Application?

Feb 4, 2012

How to secure App.config file. As it contains all the passwords that connections use so any body can see the data in my databases. If we donot save the password at the time of making connection string, will it still be able to connect with the DB the same way?

View 1 Replies

VS 2008 Where Is Application .config File

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

Make Application 'single File' And Get Rid Of XML Config File?

Dec 29, 2010

I have this pretty simple application, it uses a webService to transfer data to my servers DataBase. Now it is very important for me to keep this application as one single file, and not having some XML files needed for it to work, but this is the case. I think the XML file holds the information to this webService, so without it the application crashes. Is there a way to get the application to work without this XML file, or a way to put the XML inside the exe archive?

View 1 Replies

Embed App.config File - Application Won't Find The Dll?

Oct 17, 2010

I've just moved an external dll into a folder different from the main exe directory, so I had to use the <probing> command in an app.config file. Now however, the application won't find the dll unless I have the app.config file in the same directory as the main exe! So how can I embed the app.config file in the EXE, or alternatively move it to the folder called 'Resources' where I store the external

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved