[英]WCF Setting in code vs app.config
如果我在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>
是的 命令式运行时代码胜过声明式设置。
当首先加载配置时,您的代码将覆盖设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.