您的位置:首页 > 编程语言 > C#

[C#]关于DLL使用.exe.config 的问题,也许以下描述有一点帮助

2008-01-03 17:42 423 查看
http://www.gotdotnet.com/Community/UserSamples/Download.aspx?SampleGuid=F184E04A-37BE-48D4-91AD-6EEC7552FD40
有时间看看这个gotdotnet的示例,不过它归根结底还是EXE自己读取自己的config,和我说得问题不一样,我的问题是DLL如何读取.exe.config。

As I understand, you want to use custom configuration
data in a DLL assembly which will be used other than ASP .NET application.
Please correct me if there is any misunderstanding. I'd like to share the
following information with you:

1. You can create a .config file for your component with your custom
configuration data in the folder where the executable file (which load the
DLL) resides. Please refer to the following KB article for detailed
information:

HOW TO: Use Custom Configuration Data in a Visual Basic .NET Component
http://support.microsoft.com/?id=321585

2. If you want to create a section handler of you own, you need to extends
the interface IConfigurationSectionHandler. I believe the following article
and sample are helpful:

IConfigurationSectionHandler Interface
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemConfigurationIConfigurationSectionHandlerClassTopic.asp

GotDotNet User Sample: Alternative Config file section readers
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=f184e
04a-37be-48d4-91ad-6eec7552fd40

Please feel free to let me know if you have any problems or concerns.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=59248
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐