By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

System.Security.SecurityException

P: n/a
Hi.
I have my program written as a console application in C# .NET 2005.
I run it from a server on the local intranet and I got this message:
An unhandled exception of type 'System.Security.SecurityException' occurred
in System.Data.dll

Additional information: Request for the permission of type
'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I tried to set the security permissions.
My manifestfile look like this:

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0"
xmlns="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1"
ID="Custom" SameSite="site">
<IPermission
class="System.Security.Permissions.EnvironmentPerm ission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.FileIOPermissio n,
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1" PathDiscovery="*AllFiles*" />
<IPermission
class="System.Security.Permissions.ReflectionPermi ssion, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1" Flags="MemberAccess" />
<IPermission
class="System.Security.Permissions.SecurityPermiss ion, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1" Flags="Execution, ControlEvidence" />
<IPermission class="System.Security.Permissions.UIPermission,
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1" Unrestricted="true" />
<IPermission
class="System.Security.Permissions.KeyContainerPer mission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1" Unrestricted="true" />
<IPermission class="System.Data.SqlClient.SqlClientPermission,
System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
</PermissionSet>
</applicationRequestMinimum>
</security>
</trustInfo>
</asmv1:assembly>
Can anyone help me with this?
Carl

Mar 9 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Requesing a permision does not mean it will be granted. I think you
should grant the assemply sufficient permissions. Check out the .net
util in Control Panel.

Mar 9 '06 #2

P: n/a
Thanks for the answer.
I haved tried to change the permissions in Microsoft .NET Framework 2.0
Configuration but with no success.
Can you give me a hint?

"Truong Hong Thi" wrote:
Requesing a permision does not mean it will be granted. I think you
should grant the assemply sufficient permissions. Check out the .net
util in Control Panel.

Mar 9 '06 #3

P: n/a
I solved the problem throw this guide:
http://msdn.microsoft.com/library/de...ecpoladmin.asp

"Carl" wrote:
Thanks for the answer.
I haved tried to change the permissions in Microsoft .NET Framework 2.0
Configuration but with no success.
Can you give me a hint?

"Truong Hong Thi" wrote:
Requesing a permision does not mean it will be granted. I think you
should grant the assemply sufficient permissions. Check out the .net
util in Control Panel.

Mar 9 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more C# / C Sharp Questions on Bytes