My network-drive deployed Clickonce application worked for a while when
deployed onto the machine on which it was developed (it still works
fine on other machines). Now, when run (on the development machine),
the .exe instantiates briefly (I can see it in the task manager process
list), then just disappears (i.e. no longer in the task manager process
list) - no exceptions are raised. The bizarre thing is that if I copy
the entire name-mangled application folder (c:\document and
settings\...\local settings\Apps\2.0\... ) from its deployment
destination, and paste it somewhere else on the hard drive (c:\temp,
for example), the .exe works fine. The application is designated as a
full trust application (My Project -> Security), and I successfully
execute
Dim p As New
System.Security.PermissionSet(Security.Permissions.PermissionState.Unrestricted)
p.Demand()
early on in the code, so it doesn't appear to be a security issue. Any
ideas?
Naveen - 26 Jan 2006 18:50 GMT
If it is a partially trusted click once application it wont be visible
in the task manager. But you will see a process called Applaunch.exe,
which acts as a shim for the click once application.
You can read more about this here
http://blogs.msdn.com/shawnfa/archive/2005/11/30/498610.aspx
Nicole Calinoiu - 28 Jan 2006 12:39 GMT
Depending on how where you're executing your unrestricted permission demand,
you may not actually be testing whether your application is fully trusted.
When Demand is called for a standard CAS permission, the stack frame in
which the method is called is not evaluated for the demanded permission.
(i.e.: The method from which you call Demand gets skipped over.) If you're
making the demand from your application's Main method, there won't be any
stack frame evaluated from your application's assembly, and the demand will
pass even if your assembly is not granted unrestricted permissions. To
ensure that at least one method from your assembly is included in the
demand, simply move the Demand call into another method that can be called
from your Main method. e.g.:
Sub Main()
DemandFullTrust()
'...
End Sub
Private Sub DemandFullTrust()
Dim p As New
System.Security.PermissionSet(Security.Permissions.PermissionState.Unrestricted)
p.Demand()
End Sub
> My network-drive deployed Clickonce application worked for a while when
> deployed onto the machine on which it was developed (it still works
[quoted text clipped - 15 lines]
> early on in the code, so it doesn't appear to be a security issue. Any
> ideas?