Add connectionstring in app.config

后端 未结 6 1850
Happy的楠姐
Happy的楠姐 2020-12-17 07:05

I have a class library in C# has has several classes and a app.config. I have put ConnectionString in app.config as follows:


    &l         


        
6条回答
  •  自闭症患者
    2020-12-17 07:50

    As others have said, the library will use the config file for the executing application.

    I'd like to add one suggestion though. One option to consider, for (in my opinion) a bit of polish and a professional touch is creating a custom configuration section. That would allow you to group the settings for your library and not leave any confusion about which settings are used by your library: http://msdn.microsoft.com/en-us/library/2tw134k3(v=vs.100).aspx

提交回复
热议问题