Security Exceptions

  • Thread starter Thread starter Jessica Weiner
  • Start date Start date
J

Jessica Weiner

My windows application runs fine when the executable is saved on a the
harddisk. I uploaded the executable on my website and then used internet
explorer to download it; at the prompt I chose "run" instead of "save" and
the executable threw a System.Security.Securityexception. Whats going on
here and how can this be fixed?

Thanks.
Jessica
 
Running a .NET assembly from anywhere but the local machine can cause this.
You'll have to change you policy to allow it to be run from there.
 
Brendan Green said:
Running a .NET assembly from anywhere but the local machine can cause
this.
You'll have to change you policy to allow it to be run from there.

How do I change my policy?

Thanks.
Jess
 
You are running into the effects of Code Access Security.
Some functionality in the framework can only be run when specific rights
are allowed. When you run an application within Internet Explorer, it
runs with much more limited rights. You can change the policy (as the
other comment suggested), or you can change the application so that it
tests for rights and acts appropriately.

To learn a lot about security in the .NET Framework (including how to
change your policies), I recommend Richard Grimes' Security workshop:
http://www.grimes.demon.co.uk/workshops/securityWS.htm

Or just search the net for "code access security"

Joshua Flanagan
http://flimflan.com/blog
 
How do I change my policy?

Thanks.
Jess

Very, very carefully indeed. If you don't know how to change the
security settings on Internet Explorer then you probably don't have
enough knowledge to realise quite how dangerous what you are proposing
is.

By changing policy without sufficient knowledge you could be giving
permission for anything and everything that runs on your web-browser
to make changes on your hard disk. Every time you go onto the
Internet you will potentially be opening yourself up for big trouble.
Just say no!

rossum
 
Back
Top