Search code examples
.netnetworkingupnp

Is there a UPnP Library for .NET (C# or VB.NET)?


I'm working on a P2P application, and I need to get it to communicate through NAT Routers / Firewalls using UPnP. However, it doesn't seem that the .NET Framework includes support for UPnP.

Is there a UPnP Library for .NET? C# or VB.NET?

UPDATE: I have since found the NATUPnP 1.0 Type Library (NATUPNP.DLL) COM Component that is part of Windows (since Windows XP) that allows you to easily setup/maintain Port Forwarding using UPnP.

I wrote an article with code samples here: .NET Framework: Communicate through NAT Router via UPnP (Universal Plug and Play)


Solution

  • There is a COM library that's easy enough to access:

    UPnP APIs Purpose

    The UPnP™ framework enables dynamic networking of intelligent appliances, wireless devices, and PCs. There are two APIs for working with UPnP-certified devices:

    The Control Point API, which consists of a set of COM interfaces used to find and control devices. The Device Host API, which consists of a set of COM interfaces used to implement devices that are hosted by a computer.