I am trying to retrieve a value saved in project A settings from project B in same solution set. Is this possible in VB.NET? If possible what namespace and function would I use?

5 Years
Discussion Span
Last Post by bluehangook629

The answer is yes, you can. But ...

If you deploy it with your solution, the app.config file contains the initial settings for the application. This file has an XML format so can easely be retrieved.

The problem appears when the application A changes the settings at run time. Normally, the settings have a user scope and are stored in a user.config file in the application data (Local and/or Roaming) of the user (IE: "C:\Users\YourUserName\AppData\Local\SoftwareManufacturer\ProgramName.exe_Url_1tqa5xx0r3nrxtninucg0vbmopokfgt1\AssemblyVersion\user.config" )

You must know exacly the path to access it, and usually, this is created at the very first change of settings of the application.

In resume, you must know the right place to read the setting of the application A from the application B, and must have almost read permissions to all the path where the files are located.

To read an xml file is enough to use the system.io.streamreader. You can also import it in a dataset using the system.data.dataset.readxml() method.

Hope this helps

Edited by lolafuertes: n/a


Wow, so does this mean i need to configure my application differently for all of the users since they all are going to have different directory path to the configuration file?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.