I found source of the problem: it was System.Security.AllowPartiallyTrustedCallers
set on the non-portable assembly, which contains WhiteSpaceToken
. After I removed it, issue was gone. Looks like portable code had transparent model, which caused WhiteSpaceToken
to be more loose in the sense of security, than Token
, which in turn caused the problem as described in exception message.
Wish I those messages be more specific.