SecurityException when I run an application on local intranet
am 25.10.2007 01:27:25 von Sreekanth
I am trying to write an application which users will run from intranet
network to determine if some of the software installed or not.
Basically I am getting this information from registry. If software is
not installed, I will either start the appropriate setup.exe or open
the folder containing required setup files to install.
The problem is that I get security exception (SecurityException
System.Security.Permissions.RegistryPermission) if I run this
application from network. I am wondering if there is way to overcome
this by not tweaking any settings on user machine or I am totally in
the wrong direction and there is a better way to do this.
Thanks
Sreekanth
Re: SecurityException when I run an application on local intranet
am 25.10.2007 16:24:38 von Norman Yuan
The problem is not what your program does (reading registry or whatever). It
is that fact you are loading .NET code from outside the computer. In .NET
any running code loaded from outside the computer is considered unsafe.
So, you need to configure the running com[uter's .NET code access security
to allow code from intranet or internet to run. If you do not want to do
this configuration, you need to install the code (app) to the computer
(ClickOnce is simply a way of installation).
The configuration, called CAS ( for CODE ACCESS SECURITY), is done with a
tool called CASPOL.exe. With 1.x, there is GUI version of the tool inside
Control Panel. In 2.0, the GUI is not available to .NET redist anymore (only
avialable if you installed .NET2.0 SDK). So you need to learn DOS way (if
you have heard DOS) to do it at command line. Google CASPOL.exe brings you
hundreds of links on how to use CASPOL.exe to configure CAS. With the GUI
tool, you can even make a MSI package, so taht you can deploy the CAD policy
by your domain's group policy.
"Sreekanth" wrote in message
news:1193268445.189095.33310@e9g2000prf.googlegroups.com...
>I am trying to write an application which users will run from intranet
> network to determine if some of the software installed or not.
> Basically I am getting this information from registry. If software is
> not installed, I will either start the appropriate setup.exe or open
> the folder containing required setup files to install.
>
> The problem is that I get security exception (SecurityException
> System.Security.Permissions.RegistryPermission) if I run this
> application from network. I am wondering if there is way to overcome
> this by not tweaking any settings on user machine or I am totally in
> the wrong direction and there is a better way to do this.
>
> Thanks
> Sreekanth
>