我在 Visual Studio 2010 中工作,我有一个主项目和两个其他库项目,并且在主项目中添加了参考。每个项目都有一个设置文件。构建解决方案后,主项目只有一个 .config 文件,但库项目没有 .config 文件。因此,我无法从外部更改这些库项目的设置。
那么这个问题的解决方案是什么,我可以将库项目的 .config 文件放入我的调试/发布文件夹中?
应用程序配置
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Communicator.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="DatabaseManager.Database.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<Communicator.Properties.Settings>
<setting name="ApplicationConfigsDirectory" serializeAs="String">
<value>\Application_Configs</value>
</setting>
<setting name="MaxMeterConn" serializeAs="String">
<value>10000</value>
</setting>
<setting name="MaxPhyConn" serializeAs="String">
<value>20000</value>
</setting>
<setting name="ServerIP" serializeAs="String">
<value>0.0.0.0</value>
</setting>
<setting name="Port" serializeAs="String">
<value>1114</value>
</setting>
<setting name="TCPTimeOut" serializeAs="String">
<value>3900000000</value>
</setting>
<setting name="isTCPTimeOut" serializeAs="String">
<value>True</value>
</setting>
<setting name="SchedulerPoolingTime" serializeAs="String">
<value>480000</value>
</setting>
<setting name="startKAScheduler" serializeAs="String">
<value>True</value>
</setting>
<setting name="MinCacheAge" serializeAs="String">
<value>00:02:00</value>
</setting>
<setting name="MaxCahceAge" serializeAs="String">
<value>00:05:00</value>
</setting>
<setting name="SaveLogToDBFlag" serializeAs="String">
<value>True</value>
</setting>
<setting name="Instance" serializeAs="String">
<value>MDC_Tester</value>
</setting>
</Communicator.Properties.Settings>
<DatabaseManager.Database.Properties.Settings>
<Setting Name="Server" Type="System.String" Scope="Application">
<Value Profile="(Default)">192.168.30.181</Value>
</Setting>
<Setting Name="Database" Type="System.String" Scope="Application">
<Value Profile="(Default)">tester</Value>
</Setting>
<Setting Name="UserID" Type="System.String" Scope="Application">
<Value Profile="(Default)">root</Value>
</Setting>
<Setting Name="pswd" Type="System.String" Scope="Application">
<Value Profile="(Default)">nothing</Value>
</Setting>
<Setting Name="MaxPoolSize" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">512</Value>
</Setting>
</DatabaseManager.Database.Properties.Settings>
</applicationSettings>
<system.runtime.caching>
<memoryCache>
<namedCaches>
<add name="default"
cacheMemoryLimitMegabytes="1024"
pollingInterval="00:01:30" />
</namedCaches>
</memoryCache>
</system.runtime.caching>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
</configuration>