Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Sockets question

Sockets question

Scheduled Pinned Locked Moved C#
comhelpquestioncsharphtml
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vladimir Georgiev
    wrote on last edited by
    #1

    Hello, I am using System.Net.Sockets in my app. I took some example code from MSDN for connecting a socket to a listening server, and I put it in an Windows Control (I believe same as ActiveX)... Unfortunately, the following exception is raised when I try to call: hostEntry = Dns.Resolve(server); The actual code could be found at MSDN. Exception: --------------------------- --------------------------- Exception Object Source:mscorlib Message:Request for the permission of type System.Net.DnsPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed. --------------------------- OK --------------------------- Another important fact is that I am trying to access the control through an HTML page. Help on this issue is greatly appreciated. "Needless redundancy is the hobgoblin of software engineering." - Peter Darnell

    R 1 Reply Last reply
    0
    • V Vladimir Georgiev

      Hello, I am using System.Net.Sockets in my app. I took some example code from MSDN for connecting a socket to a listening server, and I put it in an Windows Control (I believe same as ActiveX)... Unfortunately, the following exception is raised when I try to call: hostEntry = Dns.Resolve(server); The actual code could be found at MSDN. Exception: --------------------------- --------------------------- Exception Object Source:mscorlib Message:Request for the permission of type System.Net.DnsPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed. --------------------------- OK --------------------------- Another important fact is that I am trying to access the control through an HTML page. Help on this issue is greatly appreciated. "Needless redundancy is the hobgoblin of software engineering." - Peter Darnell

      R Offline
      R Offline
      Roman Rodov
      wrote on last edited by
      #2

      Are you by any chance running your app from a link in a web browser?

      V 1 Reply Last reply
      0
      • R Roman Rodov

        Are you by any chance running your app from a link in a web browser?

        V Offline
        V Offline
        Vladimir Georgiev
        wrote on last edited by
        #3

        Hello, Yes, I attempt to run my ActiveX control through a web page (with the html tag)... Hope it gives any clues to the problem. "Needless redundancy is the hobgoblin of software engineering." - Peter Darnell

        H 1 Reply Last reply
        0
        • V Vladimir Georgiev

          Hello, Yes, I attempt to run my ActiveX control through a web page (with the html tag)... Hope it gives any clues to the problem. "Needless redundancy is the hobgoblin of software engineering." - Peter Darnell

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          You need to make sure you have a code group set up in the .NET Framework Configuration (the code access security groups) for your control. You should use Site or Url evidence (host evidence) that matches the site or url from where your control runs (the hosting page URL isn't a factory - only the URL of the control). You should make sure that the DnsPermission is granted, or just cop-out and grant that code group FullTrust permissions. .NET Code Access Security (CAS) is an important part of the .NET Framework. It's a much better sandbox than what you find in Java, and many, many times better than what's available for ActiveX. For a good article on .NET CAS, see Understanding .NET Code Access Security[^]. For more information, also see an old article of mine describing the entire process of hosting .NET controls in Internet Explorer, User Controls for Windows and the Web[^].

          Microsoft MVP, Visual C# My Articles

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups