|
I want to launch a windows app from an intranet web portal. I have done the following: -Created an msi project that installs primary output from WebPermissionClassProject -WebPermissionClassProject contains installer.vb with this: Public Sub New() ... Dim machinePolicyLevel As PolicyLevel = Nothing Dim ph As System.Collections.IEnumerator = SecurityManager.PolicyHierarchy Dim pl As PolicyLevel Do While ph.MoveNext pl = CType(ph.Current, PolicyLevel) If pl.Label = "Machine" Then machinePolicyLevel = pl Exit Do End If Loop If machinePolicyLevel Is Nothing Then Return
Dim ucg As UnionCodeGroup = New UnionCodeGroup(New UrlMembershipCondition("http://<MyActualWebServer>/*"), New PolicyStatement(New NamedPermissionSet("FullTrust"))) ucg.Description = "WebDeploy permissions" ucg.Name = "CommApps" machinePolicyLevel.RootCodeGroup.AddChild(ucg) SecurityManager.SavePolicy() End Sub
Launching the exe on my dev machine throws an error here:
System.Security.SecurityException: Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed. at System.Security.CodeAccessSecurityEngine.CheckTokenBasedSetHelper(Boolean ignoreGrants, TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet demands) at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet denied, PermissionSet demands) at System.Security.Principal.WindowsIdentity.GetCurrent() ....
On a remote machine the exe doesn't launch or throw an error; nothing happens.
If I manually create the code group using the paramters listed above, the app to works. What am I missing?
|