如果我在app.config和代码中设置了一个将被使用的设置?
示例:
Dim instance As ServiceThrottlingBehavior
Dim value As Integer
value = instance.MaxConcurrentInstances
instance.MaxConcurrentInstances = value
VS
<configuration>
<system.serviceModel>
<services>
<behaviors>
<serviceBehaviors>
<behavior name="Throttled">
<serviceThrottling
maxConcurrentInstances="1"
/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
答案 0 :(得分:1)
是的。命令式运行时代码胜过声明性设置。
答案 1 :(得分:0)
首先加载配置,您的代码将覆盖设置。