leighsword wrote:
the OS should not allow users to running my app as a partially trusted app.
You should demand the appropriate permissions at assembly level to prevent an app from being run with insufficient permissions. If you don't tell the OS what permissions you require, you can't really expect it to guess can you?
In this case, you need FileIOPermission, so you should do:
[assembly: FileIOPermission(SecurityAction.RequireMinimum, Unrestricted=true)]