If the application lives on the LAN, I think a much easier way to deploy is
to assign trust not to the assemblies' key, but to the URL which they're run
from. We do no-touch deployment using many different third-party tools, and
as long as they don't require some sort of COM registration (no normal .NET
component will [Crystal reports is not a normal .NET component] ) nothing
needs to be done to the client in order to give trust to the new assemblies,
since they're located in the trusted location. This is somewhat less secure
than assigning trust to the strong key, but more than secure enough for our
software, which is a banking package that handles data processing, reports,
and document imaging. Really, I don't see any advantages to using the strong
key instead of the location, unless you're really paranoid about security,
but I could be missing something, so no offense.
Chris
""Shawn Farkas"" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You're going to have to modify the policy on each user's machine in order
to trust this third party dll. You could do this through caspol:
>
> caspol -ag 1. -strong 3rdparty.dll -noversion FullTrust
>
> Or you can write a bit of bootstrap code at the beginning of your
application that catches the security exception thrown by this third party
dll and
> modifies the security policy to allow trust to the dll. However, doing
this will require that after the policy is changed, your application be
restarted.
> The class you're going to need to use in order to do this is
System.Security.SecurityManager. You can use its PolicyHierarchy() method
to get an
> enumerator over the PolicyLevel's on the current machine. When you find
the machine level (Where all the policy is currently stored), you can then
> create a UnionCodeGroup object, using a StrongNameMembershipCondition
object as its membership condition, and a PermissionSet
> (PermissionState.Unrestricted) permission set as its permissions. After
adding the code group, you could then call SecurityManager.Save() to
> save the modified policy, and prompt your users to restart the
application.
>
> Another option would be to create the desired policy on your machine, and
then using the .Net Framework Configuration Wizards, export the policy
> to a .MSI file that all of your users could then install.
>
> -Shawn
> http://blogs.msdn.com/shawnfa
>
> --
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
> originated.