.net - 更改已部署类库的应用程序设置?

标签 .net asp.net appsettings

如果我在类库中定义应用程序级设置(使用 Properties.Settings),我能否在将该 dll 部署到应用程序后更改这些设置?如果是这样,如何?我是否只是在 web.config 中创建等效设置来覆盖它?

最佳答案

我发现您必须在 web.config 中为类库 dll 声明一个部分。因此,如果您的命名空间是“Company.Application.DataLayer”,您需要在“applicationSettings”部分中声明一个“Company.Application.DataLayer.Properties.Settings”部分。

注意:要识别该部分,您还必须在 web.config 的 applicationsettings sectionGroup 中声明它。

关于.net - 更改已部署类库的应用程序设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1917303/

相关文章:

c# - 通过互操作将 VB6 对象传递给 .NET 对象?

.net - 如何完全序列化/反序列化 RSAParameters 对象

用于查找的 C# 最佳 IDictionary 用法,可能找不到

javascript - 如何将 GridView ID 和其他控件传递到 jQuery 函数中?

c# - 从模板生成动态 PDF

.net - 应该有 "Undefined Operation"或 "Undefined Result"吗?

javascript - 单图不同背景

appsettings - .Net core 2 控制台应用设置转换

c# - 自动生成一个强类型的 AppSettings 类

c# - Web.config 和 Web.Release.config 中的 appSettings