Он выбирает конфигурацию от %NCHOME%
InstallDir/config
. Просто добавьте следующие строки в ваших AppSettings
<add key="InstallDir" value="C:\temp"/>
Кроме того, все конфигурации клиента могут быть заданы программно с помощью CacheInitParams
. Вы можете
namespace Alachisoft.NCache.Web.Caching
{
public class CacheInitParams : ICloneable
{
public CacheInitParams();
public string BindIP { get; set; }
public ClientCacheSyncMode ClientCacheSyncMode { get; set; }
public int ClientRequestTimeOut { get; set; }
public int CommandRetries { get; set; }
public int CommandRetryInterval { get; set; }
public int ConnectionRetries { get; set; }
public int ConnectionTimeout { get; set; }
public string DefaultReadThruProvider { get; set; }
public string DefaultWriteThruProvider { get; set; }
public bool LoadBalance { get; set; }
public CacheMode Mode { get; set; }
[Obsolete("This property is deprecated. Please use the 'ServerList' property instead.", false)]
public int Port { get; set; }
public SecurityParams PrimaryUserCredentials { get; set; }
public int RetryConnectionDelay { get; set; }
public int RetryInterval { get; set; }
public SecurityParams SecondaryUserCredentials { get; set; }
[Obsolete("This property is deprecated. Please use the 'ServerList' property instead.", false)]
public string Server { get; set; }
public CacheServerInfo[] ServerList { get; set; }
public object Clone();
}
}
Знаете ли вы, в какое время он оценивает переменную '% NCHOME%'? Было бы достаточно установить переменную окружения в начале программы, чтобы изменить местоположение? –
Я отредактировал ответ. –
Извините, Basit, но 'App.config' не подходит для« программно ». Я знаю только каталог, содержащий 'client.ncconf' из параметров командной строки моего приложения. –