PC Review


Reply
Thread Tools Rate Thread

Re: how to programatically give assembly loaded from network the same trust as those loaded from local host?

 
 
Marcelo Birnbach [MS]
Guest
Posts: n/a
 
      28th Jun 2003
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.
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unload an Assembly loaded via Assembly.LoadFrom() GD Microsoft Dot NET Compact Framework 4 10th Aug 2006 04:12 AM
Good news to all those who are seeking for job in dotnet(Only those who are leaving in Hyderabad -India) BinnuChowdary Microsoft ASP .NET 0 2nd May 2006 05:13 AM
Good news to all those who are seeking for job in dotnet(Only those who are leaving in Hyderabad -India) BinnuChowdary Microsoft ASP .NET 1 1st May 2006 02:03 PM
How to unload an assembly that is loaded with Assembly.LoadForm Lloyd Sheen Microsoft Dot NET Framework 1 11th May 2004 04:16 PM
How to unload an assembly that is loaded with Assembly.LoadForm Lloyd Sheen Microsoft Dot NET 0 29th Apr 2004 03:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:59 AM.