ASP.NET web.config:configSource与文件属性

问题描述 投票:176回答:1

在ASP.NET应用程序的web.config文件中,某些配置部分,例如appSettingsconnectionStrings,支持属性fileconfigSource。] >

使用file

属性和configSource属性有什么区别?什么时候应该使用哪个属性,并且可以同时使用两者?
<?xml version="1.0"?>
<configuration>
  <appSettings file="AppSettings.config">
  </appSettings>
  <connectionStrings configSource="ConnectionStrings.config">      
  </connectionStrings>
  <!-- ... -->
</configuration>

在ASP.NET应用程序的web.config文件中,config的某些部分(例如appSettings和connectionStrings)支持属性文件和configSource。 ...

asp.net configuration web-config configsource
1个回答
282
投票

file属性

© www.soinside.com 2019 - 2024. All rights reserved.