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.
精彩评论