开发者

WCF Setting in code vs app.config

If I set a setting in the app.config and in code which one will get used?

Example:

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>
开发者_JAVA技巧      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>


Yep. Imperative run-time code trumps declarative settings.


As configuration is loaded first, your code will override the settings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜