你如何加载app.config文件到DLL [英] How do you load the app.config file into a DLL

查看:483
本文介绍了你如何加载app.config文件到DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我无法找到一个明确的答案的问题。你如何加载app.config文件到DLL。

So I cant find a definitive answer to the Question. How do you load the app.config file into a DLL.

据我所知,一般的App.config信息应放入可执行文件的app.config。但是我建立一个加载项并有可执行可用。

I understand that generally the App.config info should be put into the executable app.config. However i am building an add-in and have to executable available.

我想用namespace.dll.config文件来存储我的变量,但我需要加载到系统的一种方式。

I would like to use the namespace.dll.config file to store my variables, but i need a way of loading it into the system.

你需要打造出了一些code加载该文件?
您可以使用ConfigurationManager的命名空间来做到这一点很容易?

Do you need to build out some code to load this file in?
Can you use the configurationManager namespace to make this happen easily?

推荐答案

在这样做的方法是你要提供你的assembly.dll.config消费者的组装。然后,他们应该将这些项目纳入其应用程序的配置文件。

The way this is done is that you should supply your assembly.dll.config to consumers of your assembly. They should then incorporate those entries into their application's config file.

您大会将能够通过正常途径来访问这些值。

Your assembly will then be able to access those values through normal means.

这篇关于你如何加载app.config文件到DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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