Results 1 to 5 of 5

Thread: [RESOLVED] Referencing app.config from another solution

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    67

    Resolved [RESOLVED] Referencing app.config from another solution

    I have 2 projects in my solution.

    How do I reference the app.config in one project from the other?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Referencing app.config from another solution

    IINM, you can add a file attribute to your existing config file, like so:

    <appSettings file="C:\Path\abc.config">

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    67

    Re: Referencing app.config from another solution

    Ok. Had a play this morning and this is basically what I want to do.

    I have an app that is going to be deployed over a number of sites. there are 7 settings in the app config that need to be changed for each site (connection strings, local email account, email server etc).

    After running the deployment project I want the users to be able to run the config program. Seeing as how the configurationsettings.appsettings("KeyName") is a read only collection, I need to know how the config exe can write to the app.config file?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Referencing app.config from another solution

    The config file is XML so you would use an XmlDocument object to edit it. The link below gives an example of almost exactly what you want to do.

    http://msdn.microsoft.com/library/de...albasicnet.asp
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    67

    Re: Referencing app.config from another solution

    Brilliant site that one. Told me everything I needed to know

    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width