473,387 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can I get a client to easily trust an assembly?

I have a no touch deployment smart client app. In order to get it to run on any machine, I have to run the "Trust an Assembly" wizard from that machine and set full control for my strong named assembly. Is there a way to automate this process? I don't want to have to give out a long instruction list on setting up the app, that's why I want to use no touch deployment. Is there a way to make this easier? Thank you.
Jul 21 '05 #1
1 2530
1) There is a commandline tool (installed when the framework is installed) 'caspol.exe' which does exactly the same as the wizard.
This tool is in the folder %windir%\Microsoft.NET\Framework\your latest framework version (eg. v1.1.4322)
2) The following excerpt adjust security from code:

DimmachinePolicyLevel As PolicyLevel = Nothing
Dim ph As IEnumerator = SecurityManager.PolicyHierarchy
Do While ph.MoveNext
Dim p1 As PolicyLevel = CType(ph.Current, PolicyLevel)
If p1.Label = "Machine" Then
machinePolicyLevel = p1
Exit Do
End If
Loop

If machinePolicyLevel Is Nothing Then Return
' Intranet
Dim permissionSet As PermissionSet = New NamedPermissionSet("FullTrust")
Dim membership As IMembershipCondition = New UrlMembershipCondition("http://<some ip address>/<some directory>/*")

Dim policy As PolicyStatement = New PolicyStatement(permissionSet)
Dim codeGroup As CodeGroup = New UnionCodeGroup(membership, policy)
codeGroup.Description = "FullTrust permissions for http://<some ip address>/<some directory>/"
codeGroup.Name = "XXX"

' Internet
Dim permissionSet2 As PermissionSet = New NamedPermissionSet("FullTrust")
Dim membership2 As IMembershipCondition = New UrlMembershipCondition("http://<some ip address>/<some directory>/*")
Dim policy2 As PolicyStatement = New PolicyStatement(permissionSet2)
Dim codeGroup2 As CodeGroup = New UnionCodeGroup(membership2, policy2)
codeGroup2.Description = "FullTrust permissions for http://<some ip address>/<some directory>/"

codeGroup2.Name = "XXX"

machinePolicyLevel.RootCodeGroup.AddChild(codeGrou p)
machinePolicyLevel.RootCodeGroup.AddChild(codeGrou p2)
SecurityManager.SavePolicy()

"Harry Keck" wrote:
I have a no touch deployment smart client app. In order to get it to run on any machine, I have to run the "Trust an Assembly" wizard from that machine and set full control for my strong named assembly. Is there a way to automate this process? I don't want to have to give out a long instruction list on setting up the app, that's why I want to use no touch deployment. Is there a way to make this easier? Thank you.

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Shaul Dar | last post by:
Hi, I am looking for help with the following challenge. We are writing a Smart Client management application, which we want to appear to customers as a Web client. Hence we want to embed it...
2
by: Leonardo Spina | last post by:
I need to make the client (Internet Explorer) rua a class that I have defined in an assembly which obviously is placed on the server in the "bin" folder under the web root. How can I use that...
3
by: Iwan Petrow | last post by:
Hi I have a Web application. How could I copy a file from one path on the client machine to another path on the client machine? Thanks.
5
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called...
1
by: DotNetJunkies User | last post by:
Hi I am building a smart client application in which i am calling the assembly (exe ) on web server by assembly.loadfrom() method in client exe. I have tried deploying assembly by all the...
1
by: Harry Keck | last post by:
I have a no touch deployment smart client app. In order to get it to run on any machine, I have to run the "Trust an Assembly" wizard from that machine and set full control for my strong named...
0
by: Matt | last post by:
I have an intranet asp.net application that I am hosting a windows control in. The control is referenced using the <object> tag in the html. The control interfaces with a usb i/o device on the...
5
by: =?Utf-8?B?TWFydHluIEZld3RyZWxs?= | last post by:
Hi there. I posted an earlier issue under the name "That assembly does not allow partially trusted callers" but have now identified what the issue is. As explained before I am working in...
1
by: Jordan M. | last post by:
Hi, Hopefully someone can help or at least point me in the right direction... I have developed a site that uses the CyberSource system to process credit cards. All works great locally on my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.