Security Exception error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I get the following message as soon as I copy all the project's files on the
network and try to run it from there: (Even Build don't give me an error)
An unhandled exception of type System.Security.SecurityException occurred in
'Application Name'.
Any idea what is causing this problem. This application is in vb.net and I
don't have problem running it on my local machine.
Thanks in advance
Roy
 
You are running into the security layer in .NET called code access security (CAS). CAS is niot concerned with who is running the code, but rather where the code came from (physically or author). Trust is applied based on the code's origins.

An in fact the same thing occurs in your head everytime you start an .exe. I'm sure you don't think twice about running an exe off the start menu. However, if you surf to an internet site and click on a link that happens to be an exe - do you happily always say you want to run it regardless of the site? I assume no (either that or you have a machine heavily laden with virus's ;-) ). So having different levels of trust depending on code origin is a good thing.

So whats the problem you're having? Well by default CAS policy states that code running on the local machine runs with full trust (in other words CAS doesn't restrict what the code can do). However code running from a remote location without a dot in the hostname is assumed to be on the intranet and has a lower level of trust (for example its not allowed to access the file system directly - it must go via the common file dialogs so the user can agree to the access.

Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog

nntp://news.microsoft.com/microsoft.public.dotnet.framework/<[email protected]>

Hi all,

I get the following message as soon as I copy all the project's files on the
network and try to run it from there: (Even Build don't give me an error)
An unhandled exception of type System.Security.SecurityException occurred in
'Application Name'.
Any idea what is causing this problem. This application is in vb.net and I
don't have problem running it on my local machine.
Thanks in advance
Roy

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.770 / Virus Database: 517 - Release Date: 27/09/2004



[microsoft.public.dotnet.framework]
 
Back
Top