Groups | Blog | Home
all groups > dotnet security > february 2006 >

dotnet security : SecurityException


Goldwind
2/22/2006 8:05:33 AM
Hi,

I created a simple vb.net application which, on a click of a button, it
calls a simple web service (which i also created).

On call, i get a security exception

System.security.SecurityException: Request for the permission of type
system.net.WebPermission, system, version=1.0.5000.0, culture=natural,
PublicKeyToken=b77a5c561934e089 failed.
at system.security.CodeAccessSecurityEngine.CheckHelper(PermissionSet
grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
PermissionTokem permToken) ....

It seems like a security problem on the client.
How can i overcome it?
what to change in the solution and how?

oldbear
3/8/2006 4:59:28 AM
Hi

You need to alter the Code Access Security policy for your application.

Here's an article on partial trust applications:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000020.asp

The article states:

WebPermission is restricted. This means your application can only
communicate with an address or range of addresses that you define in the
<trust> element.

This should be the key to solving your problem.

Hope this helps

Chris Seary

[quoted text, click to view]
Goldwind
3/8/2006 5:26:32 AM
I have:

Client: Windows app which call the web service.
Server: The web service.

Where should i change the Code Access Security?

The client is the user. and i can't tell him to change the Code Access
Security for an application which he is installing.
The server is on place in an host company.

Is there no way to set the Code Access Security on installing with out the
need to change each computer's Code Access Security?

Thanks


[quoted text, click to view]
oldbear
3/8/2006 9:07:28 AM
Hi

Scripts created using caspol can be applied through group policy in Active
Directory.

Hope this helps

Chris Seary

[quoted text, click to view]
Dominick Baier [DevelopMentor]
3/8/2006 2:59:46 PM
is this client app installed locally or started from a file share?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

[quoted text, click to view]

AddThis Social Bookmark Button