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

Chris Pietschmann picture Chris Pietschmann · Dec 2, 2008 · Viewed 52.3k times · Source

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)

Answer

Aaron Murgatroyd picture Aaron Murgatroyd · May 20, 2011

I have a written a fully Managed UPnP library around the microsoft UPnP Control Point COM objects, its available with full source and a demo project, you can download it from CodePlex here:

http://managedupnp.codeplex.com/

It supports full traversal of the UPnP description documents using an object heirachy and among other things is very easy to use.