4.0.6 Trader.Connect() MethodAccessException


4.0.6 Trader.Connect() MethodAccessException
Atom
11/27/2011


Заменил 4.0.5 на 4.0.6, внес изменения, нормально скомпилировалось, запускаю, Trader.Connect() выдает:
Code
Attempt by security transparent method 'Ecng.Interop.WinApi.GetProcessId(ManagedWinapi.Windows.SystemWindow)' to call native code through method 'Ecng.Interop.WinApi.GetWindowThreadProcessId(IntPtr, Int32 ByRef)' failed. Methods must be security critical or security safe-critical to call native code.
Attempt by security transparent method '#=qKfFOb$dmmYy_28XmokQi8u_CFnpAsKDaUbiigICkX9c=.DisposeNative()' to call native code through method '#=qKfFOb$dmmYy_28XmokQi8u_CFnpAsKDaUbiigICkX9c=.#=qui7SGkL$iNzM5199s$PjSQ==(IntPtr)' failed. Methods must be security critical or security safe-critical to call native code.
System.MethodAccessException
Stack Trace:
at #=qKfFOb$dmmYy_28XmokQi8u_CFnpAsKDaUbiigICkX9c=.DisposeNative()
at Ecng.Common.Disposable.Finalize()

После замены Ecng.*.dll на Change Set 11980 выдаваемое сообщение несколько изменилось:
Code
Attempt by security transparent method '#=qKfFOb$dmmYy_28XmokQi8u_CFnpAsKDaUbiigICkX9c=..ctor(System.String)' to call native code through method '#=qKfFOb$dmmYy_28XmokQi8u_CFnpAsKDaUbiigICkX9c=.#=qcmOMPVz4o0URNxOFjmfM4g==(System.String)' failed. Methods must be security critical or security safe-critical to call native code.
Attempt by security transparent method '#=qKfFOb$dmmYy_28XmokQi8u_CFnpAsKDaUbiigICkX9c=.DisposeNative()' to call native code through method '#=qKfFOb$dmmYy_28XmokQi8u_CFnpAsKDaUbiigICkX9c=.#=qui7SGkL$iNzM5199s$PjSQ==(IntPtr)' failed. Methods must be security critical or security safe-critical to call native code.
System.MethodAccessException
Stack Trace:
at #=qKfFOb$dmmYy_28XmokQi8u_CFnpAsKDaUbiigICkX9c=.DisposeNative()
at Ecng.Common.Disposable.Finalize()

Добавление [assembly: SecurityRules(SecurityRuleSet.Level1)] и <NetFx40_LegacySecurityPolicy enabled="true"/> ничего не изменило. Подскажите, пожалуйста, что нужно поправить.

Tags:


Thanks:


Alexander

Avatar
Date: 11/27/2011
Reply


К вечеру будет фикс. Переход на Net 4.0 не такой простой как хотелось бы :)
Thanks:

Alexander

Avatar
Date: 11/27/2011
Reply


Залил исправленную версию на codeplex
Thanks:

Roman0

Avatar
Date: 11/27/2011
Reply


Alexander Mukhanchikov Go to
Залил исправленную версию на codeplex

Да, заработало, спасибо!
Thanks:

Roman0

Avatar
Date: 11/27/2011
Reply


И еще такой момент: как я понял, после первого неудачного Trader.Connect() с какой-то периодичностью предпринимаются попытки установить связь и вот во время этих попыток все исключения остаются unhandled. Есть ли какие-то варианты перехвата этих исключений (ну, кроме перехвата всех unhandled exceptions)? Может быть сообщения о таких ошибках через что-то вроде ProcessDataError выводить?
Thanks:

InsiderHSE

Avatar
Date: 11/27/2011
Reply


Alexander Mukhanchikov Go to
Залил исправленную версию на codeplex

Скачал 11998, данная ошибка не пропала...

Attempt by security transparent method '#=qKfFOb$dmmYy_28XmokQi8u_CFnpAsKDaUbiigICkX9c=..ctor(System.String)' to call native code through method '#=qKfFOb$dmmYy_28XmokQi8u_CFnpAsKDaUbiigICkX9c=.#=qcmOMPVz4o0URNxOFjmfM4g==(System.String)' failed. Methods must be security critical or security safe-critical to call native code.
Thanks:

Alexander

Avatar
Date: 11/27/2011
Reply


InsiderHSE Go to
Alexander Mukhanchikov Go to
Залил исправленную версию на codeplex

Скачал 11998, данная ошибка не пропала...

Attempt by security transparent method '#=qKfFOb$dmmYy_28XmokQi8u_CFnpAsKDaUbiigICkX9c=..ctor(System.String)' to call native code through method '#=qKfFOb$dmmYy_28XmokQi8u_CFnpAsKDaUbiigICkX9c=.#=qcmOMPVz4o0URNxOFjmfM4g==(System.String)' failed. Methods must be security critical or security safe-critical to call native code.


Не может быть. Делайте ребилд.
Thanks:

InsiderHSE

Avatar
Date: 11/27/2011
Reply


Извиняюсь, забыл ребилд сделать. Все ок.
Thanks:


Attach files by dragging & dropping, , or pasting from the clipboard.

loading
clippy