473,396 Members | 1,758 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,396 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 2531
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.