User.config Location Keeps Moving?

Nov 25, 2009

I've just started using user settings. This works ok however I'm having problems with the location of user.config.

When I run the project in Studio, user.config seems to be stored in a different place than when I build the project.

In fact every time I build it the location seems to change - users therefore lose their settings every time the project is built, which seems pretty useless.

The GUID & Assembly names etc do not change.

View 2 Replies


ADVERTISEMENT

.net - Moving App.config File To A Custom Location?

Jan 25, 2011

My application is a service application, and it needs to load a set of configuration that the user can change. I was using the System.Configuration classes to set up the app.config file, and then I was going to give the user the option of editing this file to change configuration.

Can I move this file to a custom directory, something like C:settingsapp.config? Or is it forced to reside in the app directory?

View 2 Replies

VS 2008 Getting The User.Config Location?

Sep 1, 2009

the My.Settings data is saved in the AppDataLocal folder for a user based on company.Then, inside the company folder there will be a folder for any applications published by that company, which contain the user.config file for that program.

C:Documents and SettingsRobert BurkeLocal SettingsApplication DataSerysoftSysPad.exe_Url_qr40iotmbi1lvvl4b5lecnfpoqogr5uw

The thing is, the folder for each program has a string of random alphanumeric characters at the end. I noticed that on both my XP and Win7 machine, the string is the same. What I am wanting to do is save the user.config file, but the only way to do this, seemingly, would be to hardcode that folder into the path to get the user.config file from.

how that string is generated, and what may possibly cause it to change in other releases even though, so far, it has stayed the same for several of my releases. I don't want to release a version one day and the string change and then it break my program.

View 10 Replies

Set Default Location Of User.config File?

Mar 26, 2012

I made a project in VB.NET 2008. When I update my project I change the assembly version but the problem is that when the user gets the new version they lose their user settings.[code]Note the version number in the path. Is there any way save in a location not affected by changing the version?

View 1 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 - 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

.net - Moving Program To A Location?

Jul 8, 2011

How could I move my VB.NET application to a folder using VB.NET in the same file? Essentially, I want to be able to move my VB.NET application to the Start folder when it is executed (within the same application). Also, I want to be able to move it to the same folder on any computer, for there is no set path to the Start folder on different computers. Or I would like to just create a shortcut for my application in the start folder?

View 2 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

Change The Location Of The App.config File - Vb 2010?

Feb 26, 2012

Im trying to make a program that works a bit like the log in on a computer. But i cant make it load a different .config file depending on what username is used. I want it to load a config file from different directories that match the username. eg if the username was bob then it could be: C:MyProgramLoginBobapp.config I've been teaching myself and this has had me stuck for ages.

View 16 Replies

Move The App.config File To A Custom Location?

Nov 27, 2011

I have an application that has a load of values in its app.exe.config file. The application is used by a few users, and the settings would change on a regular basis. so im having to change the config file, and send it out to all users.

I'd love to move the config file to the network somewhere and point the app to this file. ive tried to use;

Imports System.Configuration.ConfigurationManager
OpenExeConfiguration("I:app configHelpDeskQuickCallLogger.exe.config")

But i cant get it to read in the values.

View 2 Replies

Moving Contents Of A Folder To A New Location?

Sep 8, 2010

how to move a single file to a new location. Can you move the contents of an entire folder to a new location (Lets say... inside another folder)?

Here is my code for moving a file to a new location. As you might see, this is how it works. You first select a file. Then you type in the driver (C, D, E) where your 'TEST' folder is located. Then you click another button and bam! File is loaded into the TEST folder.

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[Code].....

I was moving files to a new folder when I realized some of the files were in the same folder and thought "Wouldn't it be grand to be able to just move the contents of this folder into the new without doing it one file at a time?"

View 9 Replies

Moving Labels From One Location To Another In A Form In 4?

Feb 26, 2011

I'm making a small program in which i want to move labels from one position to another , I used the following statementLabel1.Location.Y = 10 ' Error - Expression is a value and cannot be the target of an assignment

View 3 Replies

Location Of App.config File In A Windows Service Project?

Feb 2, 2012

I am creating a windows service in VS2010, and in order to store a user's input during installation I've been told to write it to a file called app.config.However i cannot find this app.config file? Does it create one in a windows service project? or just in a WCF windows service project?

View 1 Replies

Block Splitterbar From Moving To Location Point?

Nov 29, 2011

I am using splitContainer1 to split two parts of the panel. I can move the splitterbar from the left to the right. I want to know how i can block the splitterbar from being moving when reaction to the location point 202?

View 3 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

.net - Excel Interop Moving / Setting Image Location

Aug 8, 2011

We're exporting a set of data using .net interop to Excel and our template file contains some images. Depending on the amount of columns we're exporting we want to position the image X pixels left of the last column depending on the image size/width. Using the record a macro function moving the Image around is a 'no op'. Setting the Shape.Left position also won't work.

[Code]...

View 2 Replies

Locating Text In An Open .rtf File And Then Moving To That Specific Location And Displaying It In The Same Richtextbox?

Dec 6, 2010

I am loading a KJV.rtf file at program startup into RichTextBoxDisplay. When I want to select, lets say, Matthew Chapter 1, I want the program to take me to Matthew Chapter 1. I know I could just load a seperate file into the rtbDisplay, but do you know how many chapters and books are in the Bible..

View 2 Replies

Get The Variables That Are Stored In Config.user File?

Aug 6, 2010

Is there equivalent for getevn/setenv functions in VB.NET. I have looked at system.Environment.GetEnvironmentVariable but it gives the system environment variables like USERNAME, COMPUTERNAME etc. I need to get the variables that are stored in config.user file. Is there any way to do that in VB>NET.

View 2 Replies

Empty User.Config File Causes Exception?

Sep 13, 2007

Somehow the User.Config file was corrupted for an instance of my VB .NET app. When access one of my user level config property (My.Settings.MyProp) I get the a ConfigurationErrorsException with the message "Configuration system failed to initialize." I looked at the User.Config file and found that it is empty, it can be opened but there is no XML text contained within.I would like to programmatically fix the file if an exception is seen. When I attempt to use any of my user level properties, I continue to get the same exception. I've tried calling the Reset() but that yeilds the same exception. I then tried Save() to see if it would write out a default version, but it appears to do nothing (the file is not updated). My.Settings appears to be useless at this point.How can I reinitialize the User.Config file to the default config settings without deleting the old file? I would think that there should be some mechanism for restoring this file back to its default. And how can I update/reinitialize the My.Settings instance so that I can access the properties normally?

View 17 Replies

Reusing And Cleaning Up User.config Files?

Nov 11, 2010

Not sure if this has been asked before (couldn't find an answer), but is there a way to reuse a user.config file from a previous version of the application? For example a user.config file is stored in:

C:UsersJohnnyAppDataLocalCompanyApplicationName.exe_Url_wxcnyrmstqy3oj1qwckdjq3gjqkq4fel1.0.0.0user.config After a new version is installed it gets stored in:

C:UsersJohnnyAppDataLocalCompanyApplicationName.exe_Url_wglmejvw01nagu5t1y5yl12chynjomny1.0.0.1user.config The user then has to enter all settings again, even if the new version does not save more settings. An other problem is that although the user.config file is very small, it does get messy after a while when newer versions of the application get installed. Is there a way to clean up the unused user.config files and their folders?

It's the same problem with System.Windows.Forms.Application.LocalUserAppDataPath, that I'd like to use to save other files (containing Listview data), which points to:

C:UsersJohnnyAppDataLocalCompanyApplication1.0.0.0 The Listview data and other files created by the app can't be used anymore.This can be solved by getting the user's appdata folder with Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) and creating a new folder there with the name of the application. But this means there's one folder where the application is installed (user can choose this folder in the installer), one folder to save my own files to and one folder where VB stores the user.config file.

Can something be done about this "mess" or is this just something I have to live with?

View 2 Replies

Updating The Non-VSHost Exe's User.config File?

Apr 25, 2012

I have a program that runs fine in the debugger. I started on the project in x86 mode this January and I've always been able to run it outside of the debugger, but this is the first time I've seen this error.The error says "ConfigurationErrorException was unhandled: Configuration system failed to initialize."The InnerException of the error said that the error was in the user.config file, and it gave me the directory of the user.config file that it was using. So I clicked synchronize in the project settings thinking that it would overwrite the current user.config file and that would probably fix the error. When it showed the confirmation dialog that it would delete the user.config file, I noticed that it had "vshost" in the directory.

View 1 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

Forms :: Save Data To User.config That Is Not Bound?

Sep 23, 2009

I would like to commit the data put in a checkedlistbox to the user.config. I have found a way to commit them to my.settings but no matter what Save() method I call, it does not commit the new data (that is not bound to a control, through the propertybindings) to the user.config, either immediately or when I shutdown the application. Which means, when I loop through the settings when the application starts back up, the data is not there to be added back to the checkedlistbox. I have put save methods in the formclosing events as well as when the data is created in the my.settings. using my.mysettings, my.settings and my.settings.default. Thank you in advance for your input.

This first method is a called when a button is pushed. it checks the text and then calls the next method (AddProperty) which should add the property to my.settings and save it to user.config, but my understanding is that it is not written to the file till the applicatoin closes.

[code]...

View 5 Replies

VB2005 :: Save Data To User.config That Is Not Bound?

Sep 18, 2009

I have done a fair amount (days)of searching, before posting this,and cannot seem to find an answer.ata put in a checkedlistbox to the user.config. I have found a way to commit them to my.settings but no matter what Save() method I call, it does not commit the new data (that is not bound to a control, through the propertybindings) to the user.config either immediately or when I shutdown the application. Which means, when I loop through the settings when the application starts back up, the data is not there to be added back to the checkedlistbox. I have put save methods in the formclosing events as well as when the data is created in the my.settings

View 3 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

Wpf - Saving User Config Data To XML And Relative URI Error

Mar 4, 2010

I am working on a program where some application config info is stored in a Userconfig.xml file. I am loading the file as an XMLDataProvider in the XAML via relative URI:

<XmlDataProvider x:Name="UserConfigDataSource" x:Key="UserConfigDataSource" Source="UserConfig.xml" d:IsDataSource="True"/>

I have a number of items throughout bound to elements in the document and an event handler that saves to the XMLDataProvider:

Private Sub SaveConfig(ByVal sender as Object, ByVal e as System.EventArgs)
'TODO: Add event handler implementation here
Dim SavePath As String = UserConfigDataSource.Source.LocalPath.ToString

[Code]....

When this executes I get the error "This operation is not supported for a relative URI". Is there a good way to produce an absolute URI (aside from getting the assembly executing location and trimming the executable filename from the end)? I expected this to be a somewhat simple procedure.

View 2 Replies

Prevent User From Moving Form

Jan 7, 2009

I have the following settings:

ControlBox : False
WindowState: Maximized

Because I want the user to have a full screen application that they cannot close without using my Exit menu. The problem is, they can simply grab the title bar of the form and drag it, exposing the desktop!

View 3 Replies

User Picturebox Moving In Runtime?

Mar 21, 2010

I'm creating an application in visual basic, basically a part of it is where I hope to achieve the function whereby users can move pictureboxs(images) when visual basic is running.

Basically, i've got several picture boxes that obviously cannot be moved around the form at the minute.

For example, i want to be able the user to be able to move picturebox1 around the form when they click on it and move it where they want to as opposed to what it does now - doesnt move.

View 14 Replies

How To Write User Input From Textbox To Web Config File In HTML

Feb 20, 2012

I am trying to obtain a file path that users manually enter on a web page, and then write it to the web.config file.

View 4 Replies

Active Directory Moving User Accounts To A Different OU

Sep 1, 2011

I am a programmer for 6 years with VB6, now I am using VB 10 Express and working with Active Directory for the first time. I have been able to make a lot of things work with AD.I have been trying time and again to make this work. I have been googling and trying samples and keep running into one error after another, the latest is a [code] "There is no such object on the server."[code] My objective for this is to move the user account from the office OU to the Disabled OU. I have been fighting this for so long that I am going crosseyed.[code]

View 1 Replies







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