- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我有一个一般性问题,但我也会解释为什么要问,以便您更好地理解我的意思。
我有一个 dll,它有一个在设置中定义的 web 服务 url,在运行时它使用 Settings.Default 从设置中获取 url。但是,我们的环境都没有 (dllName).dll.config 文件,并且在调用应用程序的 (exeName).exe.config 中没有定义具体设置。很明显没有使用默认值,因为它设置为某个内部 IP 地址;但这在生产中有效,他们没有在我能找到的任何 .config 文件中定义此设置,并且它仍然以某种方式访问正确的 Web 服务 URL。在这种情况下,我需要知道从哪里加载值。
所以我的更广泛的问题是,层次结构如何在 .net 中加载设置?例如,它是否首先查看 machine.config,然后是 (exeName).exe.config,如果它是一个 dll,它会转到 (dllName).dll.config 吗?它首先看哪里,在其他地方看起来是什么顺序,还有没有其他地方我没有提到可以定义这个配置?
此外,对于 DLL,如果您在“设置”中定义了某些内容,它是否会作为默认值嵌入到已编译的 dll 中,如果在任何其他 .config 文件中找不到该属性,是否会使用它?
最佳答案
The hierarchical nature of .NET configuration provides a great level of flexibility, allowing specific users or locations to have their own configuration settings. However, those configuration settings are not isolated and duplicate settings made at a more specific level have the ability to override settings made at a less specific level. As can be seen in picture, the most specific configuration files are merged into the less specific, with the most specific settings overriding the least specific. In the Exe context, User (or to be more precise, Local User) settings are most specific, followed by Roaming User (shared between two or more machines), Application and, finally, Machine.
我建议您阅读以下文章,因为您的回答只是引用:
有用的是:
关于c# - 什么是用于加载系统配置属性的 .net 层次结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12114336/
MySQL优化方案 想必大家都知道,面试期间一提到数据库,就会聊到数据库优化相关问题。网上关于数据库优化的文章也是眼花缭乱,层出不穷。今天将会通过这篇文章细分几点给大家汇总整理出一套关于MySQL数据
我正在尝试使用 Django 后端移植 Angular 2 教程 这是我的html文件 Angular 2 QuickStart
如何在 Fusion 票证中配置 Paypal 系统。在 My Fusion 票证中保持系统正常工作。 付款:现金装运:销售点(正在工作) 付款:发票:请在事件后 10 天内或 3 天内付款,如果更早
所以在 NixOS 上我们可以编辑文件 /etc/nixos/configuration.nix指定我们的“输入”系统配置。然而,当我们运行 nixos-rebuild switch要构建和激活我们的
我最近开始使用 Angular 2 进行开发。那里有很多教程。但是我仍然无法理解的一件事是 systemjs.config.js。 我明白为什么要使用它,它的主要目的是什么。但是如何使用它来添加其他依
在 system.xml 中,我可以为部分和组定义一个 frontend_type。 Mage_Catalog 示例。 separator-top Cata
在使用第三方 dll 时出现以下异常: exePath must be specified when not running inside a stand alone exe 有以下踪迹 System
我是一名优秀的程序员,十分优秀!