if you google it, some people say that you have

legacy cas model or legacy security policy model on your app.config or machine.config

the error will ocurr when you use any dynamic variable within your source code

but in my case, neither is working

so what to check?


Confuguration Manager

in my case, i want my application to run on x86

but there is some dll which have combination Any Cpu/x86

simply remove Any Cpu from configuration manager solve my issue