views:

351

answers:

1

Is it possible give full trust, programmatically to an ActiveX control embedded in a web page?

We are trying to build an activeX dll which creates and open a word document and refreshes its data based on some data from another site. It works fine, if I give the assembly full trust from Administrator Tools -> .net 2.0 configuration tool.

Can this be done through code ?

+1  A: 

I don't think so. Code permissions can only be set through the configuration of an application, and even if it can be done through code, then the code that sets them would need to have permission to do this as well. Even then the settings from the web.config or machine.config would take precedence.

The point of these code permissions is that admins are able to control what an application can do. If the AppDommain for your application doesn't have rights to do certain things, why would and ActiveX you create have them?

Slavo
You are right, it cannot be done. But this is possible for Java applets.
gk