且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

.NET - 存储一个app.config有了一个类库

更新时间:2022-12-08 13:20:26

您真的不能以同样的方式为可执行文件与一个类库.config文件!然而,一个类库当然可以读写XML文件,这样你就可以伪造它在一定程度上。 code项目本文介绍这样做的一种方法,我也不会,如果有其他类似的解决方案,因为正如你所说,这是一个常见的​​问题感到惊讶。

You really can't have .config files with a class library in the same way as for executables! However, a class library can of course read and write xml files so you can fake it to a certain extent. This code project article describes one way of doing it, I wouldn't be surprised if there are other similar solutions, since as you say, it's a common question.