leighsword wrote:
Sven Groot wrote:
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)]

well,it's my mistake, this is not an OS bug,but it absolutely is an .Net framework bug, and i hope this bug will be fixed in .net 2.0 .

why we need to write extra statements to fix a MS bug in our apps,is it really need?
old chinese told us, '画蛇添足'.

画蛇添足 (hua4 she2 tian1 zu2)(draw+snake+add+foot)
  • Literally: adding legs when painting a snake
  • Moral: Don't overdo something.
  • English equivalent: to gild the lily


It’s not a glitch in the framework. It’s a security system. I don’t know about you, but I don’t want every program I run to have full access to my file system. Also, you don’t want your programs auto-declaring every statement that would cause an error. Because all a declaration says is if I don’t have permission, fail immediately. What if your program could do 99.99% of its tasks without the permission, and the part that needs is only used under some uses of your program; you would still want to be able to perform the other uses under a partially trusted environment.