ASP.NET solution with class library project

后端 未结 1 644
情话喂你
情话喂你 2021-02-14 19:36

I have an solution in VS 2008 which contains two class library projects and an ASP.NET web site. The ASP.NET site references the class libraries and one of the libraries contain

相关标签:
1条回答
  • 2021-02-14 20:15

    This caused me a bit of confusion at first as well.

    You might think that the class library uses the app.config file that's contained in it's own project but it doesn't. It uses the config file of the project that is referencing it.

    So what you need to do is look for the <appSettings/> tag inside the web.config file of your ASP.Net project and change it to <appSettings></appSettings> And add the <add ... /> tags that are contained in the app.config file of the library project. You don't need to change anything in your code for the ConfigurationManager class to figure this out. It knows where to look automagically.

    Hope that makes sense.

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