Re: how to programatically give assembly loaded from network the same trust as those loaded from loc

Discussion in 'ASP .Net' started by Marcelo Birnbach [MS], Jun 28, 2003.

  1. 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" <> wrote in message
    news:%...
    > 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" <> wrote in message
    > news:...
    > > 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/default.asp?url=/library/en-us/dnforms/htm
    > l/winforms11122002.asp
    > >
    > > - Michel Gallant
    > > MVP Security
    > >
    > > "JS" <> wrote in message

    > news:%...
    > > > 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.
    > > >
    > > >

    > >
    > >

    >
    >
     
    Marcelo Birnbach [MS], Jun 28, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Diego F.
    Replies:
    0
    Views:
    1,799
    Diego F.
    May 23, 2005
  2. BinnuChowdary
    Replies:
    1
    Views:
    575
    Swanand Mokashi
    May 1, 2006
  3. BinnuChowdary
    Replies:
    0
    Views:
    442
    BinnuChowdary
    May 2, 2006
  4. BinnuChowdary
    Replies:
    1
    Views:
    624
    =?UTF-8?B?R8O2cmFuIEFuZGVyc3Nvbg==?=
    May 2, 2006
  5. Replies:
    1
    Views:
    1,057
Loading...

Share This Page