开发者

class needs info from either the web.config or app.config

Our main application has both a asp.net and winforms component. There is a class that is used by both sides and needs info from either the web.config or app.config files. The class itself does not know if it’s on the client side or on the web server (at this point). We are getting errors when it’s attempting read app.config when it’s on the web side. Is there a way for the class to tell if it needs to read web.config or app.config? My first thought was to put it in a try ca开发者_运维问答tch block but I am wondering if there is a more elegant way Thanks


You can create the web.config and the app.config. The settings manager will get the right one for your each scenario.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜