App.config中的一个类库 [英] app.config for a class library

查看:156
本文介绍了App.config中的一个类库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看不到由VS2008向导类库生成的app.config文件。在我的研究,我发现,在一个应用程序只有一个app.config中存在。

I cannot see a app.config file generated for a class library by the VS2008 wizard. In my research I found that in an application only one app.config exists.

这是个坏事手动添加一个app.config到一个类库还是有什么其他的方法,这将成为一个app.config的目的类库?

Is it a bad thing to add an app.config manually to a class library or are there any other methods which will serve the purpose of an app.config in class library?

我需要存储的log4net配置app.config文件内的信息。

I need to store log4net config information inside the app.config file.

推荐答案

您一般应的的添加的app.config 文件到一个类库项目;它不会没有一些痛苦的弯曲和扭曲你的一部分使用。它没有的伤害的库项目在所有 - 它只是不会做任何事情。

You generally should not add an app.config file to a class library project; it won't be used without some painful bending and twisting on your part. It doesn't hurt the library project at all - it just won't do anything at all.

相反,您可以配置它使用图书馆中的应用;因此所需的配置信息会去那里。每一个可能会使用你的库应用程序都会有不同的要求,所以这实际上使得逻辑意义了。

Instead, you configure the application which is using your library; so the configuration information required would go there. Each application that might use your library likely will have different requirements, so this actually makes logical sense, too.

这篇关于App.config中的一个类库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆