2010-01-31 108 views
1

如果我在app.config中設置了一個設置,並在代碼中使用了哪個設置?代碼中的WCF設置vs 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

是的。聲明式運行時代碼勝過聲明式設置。