Combining multiple config files in Visual Studio

前端 未结 4 1514
走了就别回头了
走了就别回头了 2021-02-14 17:02

I have a solution in Visual Studio 2008 which contains multiple C# projects. Each project has it\'s own config file (App.config and Settings.settings). This makes sense architec

相关标签:
4条回答
  • 2021-02-14 17:18

    After more digging, I found this quite useful post

    http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/2710647c-6414-42c4-90b7-fd7603f55ae0/

    Just in case anyone runs into the same issue, the above seems to be the most practical way of getting around it. Although beware that with this solution creating setup packages may become tedious:

    http://bytes.com/groups/net-c/498720-app-config-dll-not-getting-added-setup-project

    0 讨论(0)
  • 2021-02-14 17:38

    I don't believe there is. But just in case you're unaware.

    0 讨论(0)
  • 2021-02-14 17:43

    I'm not sure if this is what you are looking for or if it will help but just as a lead into an area to explore, note that you can link two Config files. For example, I have my connection string in a separate file so my connectionStrings line in Web.config reads:

    <connectionStrings configSource="WebCS.config"/>
    

    Then, in the separate file, I have:

    <connectionStrings>
        <add name="BSDIConnString" 
             connectionString="Data Source=XXX;Initial Catalog=XXX;User ID=XXX;Password=XXX" 
             providerName="System.Data.SqlClient"/>
    </connectionStrings>
    
    0 讨论(0)
  • 2021-02-14 17:45

    OK good people, all you will ever need to know about VS config files:

    http://geekswithblogs.net/akraus1/articles/64871.aspx

    0 讨论(0)
提交回复
热议问题