Monday, July 29, 2013

Request for the permission of type 'System.Net.DnsPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

hello,


Am trying to find user's ipadress using below code,



IPHostEntry host;
string localip = "";
host = Dns.GetHostEntry(Dns.GetHostName());

foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily.ToString() == "InterNetwork")
{
localip = ip.ToString() + "-";
}
}

but am getting the below exception.



Request for the permission of type 'System.Net.DnsPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed



so i thought it must be the permission issue so i gave full trust level from web.config file. But still it showing the error. can any one tell me how to resolve this issue.


No comments:

Post a Comment