Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 57
  • Last Modified:

Visual Basic Solution-wide data connection

Good morning. I have an App.config file in one of the projects in my solutions. What I'd like is that from another project created within the same solution I am able to reuse this App.config file in this project, so that I don't have to manage two (or more) data-connection configurations.

Thanks in advance for your urgent help.
0
mhas01
Asked:
mhas01
  • 3
  • 2
1 Solution
 
CodeCruiserCommented:
One way to achieve this would be to use a DLL project to maintain the common config. This DLL can then be referenced in other projects to obtain the configuration.
0
 
mhas01Author Commented:
I'd refuse to do that ... I'd do it only if it was not possible from the built-in functions, (I mean, it would be like re-writing the whole visual basic approach) best-practices, some already existing methodology within visual studio 2012, visual basic, that I could in my solution add new projects and have these projects inherit the datasets already existing in the main project of the solution.

 I was thinking maybe the app.config file, but how? Thanks again!
0
 
CodeCruiserCommented:
>and have these projects inherit the datasets already existing in the main project of the solution

A solution can have a startup project, a project which is started when you run the solution itself instead of an individual project, but I am not aware of any way of having a main project which other projects can link to without having a reference to the project.
0
 
mhas01Author Commented:
Ain't it possible, somehow, to utilize one project's App.config file from another project as its own? Like an include?
0
 
CodeCruiserCommented:
You can use ConfigurationManager class to open a config file but this requires path information

http://msdn.microsoft.com/en-us/library/ms224437(v=vs.110).aspx
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now