[英]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.