Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6898231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:16:11+00:00 2026-05-27T07:16:11+00:00

im doing client and server socket communication in c# but i got this error..

  • 0

im doing client and server socket communication in c# but i got this error..

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

what is the posibility for this error.. i run my application using another machine but it seems ok.. this error comes out when i use Windows SP3 with the latest .Net

i think the reason is im using a deprecated syntax in .Net

IPAddress IPAddress = Dns.GetHostByName(Dns.GetHostName()).AddressList[0];

for getting the machine IPAddress.. is there another syntax for doing this? which is not deprecated..? i googled it and tried some blocks of code but IPAddress return IPV6 IP type.. 😀

any help please.. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:16:11+00:00Added an answer on May 27, 2026 at 7:16 am

    Did you try this..

     using System.Net;
    
    string host = Dns.GetHostName();
    IPHostEntry ip = Dns.GetHostEntry(host);
    Console.WriteLine(ip.AddressList[0].ToString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a custom TCP server and client and on doing a ton of
I am doing some client side validation in ASP.NET MVC and I found myself
I am working with ASP.NET doing some client side javascript. I have the following
I've programmed a client-server application for Android and I'm doing the same for Iphone.
I'm trying to implement a server-client socket program in Java that can support multiple
Okay so this is what I'm trying to do in my python socket server.
I have a basic socket server that looks like this: IPEndPoint localEndPoint = new
I used npm to install socket.io. The server is running fine but is not
I have been doing socket programming for many years, but I have never had
I am doing a client-server voice chat program(unmanaged C++,win32) in which clients connects to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.