You can modify the security policy in different ways:
1. Deploying an MSI package that is created using the .NET configuration
tool
2. Use caspol.exe in a script
3. Programatically: look docs for Security.System.SecurityManager
Anyway, it's a BAD idea to change policy giving FullTrust to the
LocalIntranet! That would mean that every application coming from the
intranet will be able to do whatever in your system. Why don't you sign the
assembly and give it the appropriate set of permissions instead of
FullTrust?
Thanks,
Marcelo
"JS" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> But within the server process running on local process, I guess that I can
> the grant permission to the assembly before loading it. How do I do it
> programatically?
>
> "Michel Gallant" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Of course, the assembly can't dynamically grant itself whatever
> permissions
> > it wants. Otherwise CAS wouldn't be of much use.
> > You can programatically configure the security policy, and then
distribute
> > is as an MSI installer to end users.
> > This process, with useful code samples is described at:
> >
> >
>
http://msdn.microsoft.com/library/de...us/dnforms/htm
> l/winforms11122002.asp
> >
> > - Michel Gallant
> > MVP Security
> >
> > "JS" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > > I have a .net assembly accesing COM service, the .net assembly resides
> on
> > > network drive. When the assembly is run, I got 'securitypermission'
> > > exception. If in '.net wizard->adjust .net security->adjust the
> security
> > > level for each zone', I gave 'local intranet' zone 'full trust'; the
> same as
> > > for 'my computer' zone, then there is no such exception.
> > >
> > > How do I programatically do so? When I load the assembly (and run the
> > > assmbly) in a program, I would like to give this assemnly full trust
in
> this
> > > program so that it can access COM service.
> > >
> > > If this assembly is not using COM service, I think that there won't be
> such
> > > a problem.
> > >
> > > Thanks.
> > >
> > >
> >
> >
>
>