Ошибка при подключении
Atom
18.06.2012


Перешел с 4.0 на версию библиотеки, которую выкачал из кодеплека сегодня утром (18.06.2012)
Не могу понять что происходит.
Если программа запущена из под отладчика VS то она успешно подсоединяется к квику.
(правда работает 10 минут из-за проблем с лицензией, но это второй вопрос).
Но если программу запустить из проводника, то получаю сообщение об ошибке, которое привожу на скрине

Подключаюсь вот так:
if (quikPath.IsEmpty())
{
const string Msg = "Путь к QUIK не установлен!";
MessageBox.Show(Msg, Resources.AttensionStr, MessageBoxButtons.OK, MessageBoxIcon.Information);
}

this.quikTrader = new QuikTrader(quikPath).GuiSyncTrader(); // создаем шлюз к Quik-у и синхронизуем его
this.logManager.Sources.Add(this.quikTrader.Trader);

Разумеется лог не создается. Помогите, пожалуйсто! Я спать хочу :-(

Что касается лицензии, то выкачал файл лицензии программой LicenseTool и поместил ее в каталог
с программой. При запуске (из отладчика) получаю сообщение "ProcessIsDataError: The type initializer for 'StockSharp.Algo.Licensing.LicenseHelper' threw an exception."

Привожу лог:
13:45:01.820 | Error | QuikTrader | System.TypeInitializationException: The type initializer for 'StockSharp.Algo.Licensing.LicenseHelper' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Ecng.Security.CryptoAlgorithm' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Ecng.Reflection.Emit.AssemblyHolder' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Ecng.Configuration.ConfigManager' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System' or one of its dependencies. Не удается найти указанный файл.
at System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalConfigHost host, String typeString, Boolean throwOnError)
at System.Configuration.MgmtConfigurationRecord.CreateSectionGroupFactory(FactoryRecord factoryRecord)
at System.Configuration.MgmtConfigurationRecord.EnsureSectionGroupFactory(FactoryRecord factoryRecord)
at System.Configuration.MgmtConfigurationRecord.GetSectionGroup(String configKey)
at System.Configuration.ConfigurationSectionGroupCollection.Get(String name)
at System.Configuration.ConfigurationSectionGroupCollection.<GetEnumerator>d__0.MoveNext()
at Ecng.Configuration.ConfigManager.<>c__DisplayClass4.<.cctor>b__1(ConfigurationSectionGroupCollection groups)
at Ecng.Configuration.ConfigManager..cctor()
--- End of inner exception stack trace ---
at Ecng.Configuration.ConfigManager.GetSection[T]()
at Ecng.Reflection.Emit.AssemblyHolder..cctor()
--- End of inner exception stack trace ---
at Ecng.Reflection.Emit.AssemblyHolder.get_NeedCache()
at Ecng.Reflection.FastInvoker.CreateDelegate(Type delegType, Type instanceType, Type argType, ConstructorInfo ctor, MethodInfo method, MemberInfo member, Nullable`1 isGetter)
at Ecng.Reflection.FastInvoker.<>c__DisplayClass1.<CreateCore>b__0(MemberInfo )
at Ecng.Collections.CollectionHelper.SafeAdd[TKey,TValue](IDictionary`2 dictionary, TKey key, Func`2 handler, Boolean& isNew)
at Ecng.Collections.CollectionHelper.SafeAdd[TKey,TValue](IDictionary`2 dictionary, TKey key, Func`2 handler)
at Ecng.Reflection.FastInvoker.CreateCore(MemberInfo member, Nullable`1 isGetter)
at Ecng.Reflection.FastInvoker.Create(PropertyInfo property, Boolean isGetter)
at Ecng.Reflection.FastInvoker`3.Create(PropertyInfo property, Boolean isGetter)
at Ecng.Reflection.ReflectionHelper.GetValue[A,V](MemberInfo member, A arg)
at Ecng.Reflection.ReflectionHelper.GetValue[A,V](Type type, String memberName, BindingFlags flags, A arg)
at Ecng.Reflection.ReflectionHelper.GetValue[A,V](Type type, String memberName, A arg)
at Ecng.Security.CryptoAlgorithm..cctor()
--- End of inner exception stack trace ---
at Ecng.Security.CryptoAlgorithm.Create(AlgorithmTypes type, ProtectedKey[] keys)
at StockSharp.Algo.Licensing.LicenseHelper..cctor()
--- End of inner exception stack trace ---
at StockSharp.Algo.Licensing.LicenseHelper.IsLicenseSupport(Type featureType)
at StockSharp.Algo.BaseTrader..ctor(Boolean checkLicense)
GUI.jpg 165 KB (246)

Теги:


Спасибо:


< 1 2 3 
Alexander

Фотография
Дата: 18.06.2012
Ответить


Может стоит чуток поспать? :)
Спасибо: Mikhail Sukhov

Роман Угрюмов

Фотография
Дата: 19.06.2012
Ответить


Вопрос закрыт, переделал из WindowsForm приложения в WPF
Работает аккуратно. Исчезли проблемы с синхронизацией времени и лицензией.
Благодарю за помощь!
Спасибо:
< 1 2 3 

Добавить файлы через драг-н-дроп, , или вставить из буфера обмена.

loading
clippy