Running an Application remotely from the Server gives a Security Policy error  
Author Message
.Net Pro





PostPosted: .NET Base Class Library, Running an Application remotely from the Server gives a Security Policy error Top

Running an Application locally works but if running from the Server,it gives a Security Policy error.

Even tried making it a full trust application by going to the Security tab and checking off "Enable  ClickOnce settings" and selecting - This is a full trust application.

I get the foll error when I try to run it from the server.

Details

System.Security.SecurityException: Request failed.
   at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
   at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
   at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException)
   at System.Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack cs, PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Assembly asm, SecurityAction action)
   at SetupMachineInfo.Form1.Form1_Load(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The action that failed was:
LinkDemand
The type of the first permission that failed was:
System.Security.PermissionSet
The Zone of the assembly that failed was:
Intranet



.NET Development14  
 
 
ahmedilyas





PostPosted: .NET Base Class Library, Running an Application remotely from the Server gives a Security Policy error Top

I am unsure but from the things I have read, you need to strong name your assembly/make it trusted to run from a server/remotely.

 
 
Norbert Eder





PostPosted: .NET Base Class Library, Running an Application remotely from the Server gives a Security Policy error Top

Hi,

Have you tried to set the appropriate permissions in the .NET Configuration under Settings/Adminsitrative Tools



 
 
Anjali





PostPosted: .NET Base Class Library, Running an Application remotely from the Server gives a Security Policy error Top

thank you so much for replying.

But is there any way - if that is the only way - I can set the project properties or such... so that I do not have to go to the user's machine to change the settings.


 
 
BrianNoyes





PostPosted: .NET Base Class Library, Running an Application remotely from the Server gives a Security Policy error Top

You will need to actually publish the application with ClickOnce in order to take advantage of the full trust configuration. If you publish with ClickOnce, then point the user to the URL to the deployment manifest on the server, they will get a local install and the security will get cranked up through the install prompt.

If you really want to run the executable direct from the server, you will have to configure security on each client machine manually or through group policy, and generally deploying a policy based on your development team strong name key is the best way (inferring that you strong name the executable with that key).



 
 
Anjali





PostPosted: .NET Base Class Library, Running an Application remotely from the Server gives a Security Policy error Top

Thanks Brian. this makes sense.

I tried publishing and that does work.

For the other option, Can you please tell me how to configure security on the client machine through a group policy and

how to "deploy a policy based on your development team strong name key ".

thanks for all your help.


 
 
BrianNoyes





PostPosted: .NET Base Class Library, Running an Application remotely from the Server gives a Security Policy error Top

The steps for the group policy deployment of .NET security policy I don't know off the top of my head. That is something to ask your domain admins.

In terms of deploying a policy based on strong name, at a high level, you need to:

- Strong name your assemblies

- Create a custom code group in the .NET security policy with a membership criteria that matches your strong name

- Put the code group on each machine that will need to launch apps from that publisher (you can generate an msi to do this manually through the .NET Configuration tool).

This post talks about this some:

http://blogs.msdn.com/shawnfa/archive/2005/04/14/408284.aspx