开发者

How to make the Setting works for Class Library project in C# 2.0?

I am putting the setting under the property of one of my C# Class Library project for app setting:

EUCAccountService_ConnectionString
EUCTelcoDB_ConnectionString

In the development, it works nicely. Until I deported to production, I realise that the component that use those thing .. it just hang. I found that under \BIN when it compiled dewaCorp.EUC.TelcoDB.Data.dll.config and open up that file and turn out nothing.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
</configuration>

How to make this works? I thought by compiling it, it turned to some sort config file or so开发者_开发百科mething. But it didn't.

I am appreciated your comment.


The properties are not stored in the .config file they are stored in the windows user profiles. To store setting in the .config file add a config file to the executing assembly (take note is important to use the executing assembly) and store add the settings there for connection strings there is a special note for them.

 <ConnectionStrings>
      <ConnectionString />
 </ConnectionStrings>


You'd better take a look at similar projects, such as log4net, and Enterprise Library.

http://logging.apache.org/log4net/index.html

http://www.codeplex.com/entlib

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜