System.Security.SecurityException using a LINQ query

Created at 12 Aug 2017, 19:26
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
nmaxcom's avatar

nmaxcom

Joined 23.05.2016

System.Security.SecurityException using a LINQ query
12 Aug 2017, 19:26


I'm aware that using FullAccess rights will get rid of this exception. But it seems like an overkill to me: I'm not reading any local files, connecting to the internet or otherwise.

I'm just using (for example):

Positions.OrderByDescending(x => x.GrossProfit).Last()

What kind of rights am I violating with this? What's the most restrictive AccessRights I can set to be able to use this?

Thanks.


@nmaxcom
Replies

ClickAlgo
15 Aug 2017, 16:26

I see your question has not been answered yet, so I created a new cBot with no AccessRights and ran the code below in the OnStart method.

var positions = Positions.OrderByDescending(x => x.GrossProfit).Last();

The line of code executed fine, your problem may be in another code block somewhere.


@ClickAlgo

Spotware
16 Aug 2017, 11:58

Dear nmaxcom,

Indeed we cannot reproduce your issue. Can you please provide a cBot that reproduces the exception so we can investigate further?

Best Regards,

cTrader Team


@Spotware