Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C# Implementation Guide
04-08-2014, 09:46 PM
Post: #1
C# Implementation Guide
Good afternoon all,

I've been using UPnP off and on for the last year using the Intel C# Stack. Things aren't documented there and it's been a bit difficult to debug my code and their code.

Anyway, I'm looking at jumping over to using OhNet instead to see if it's more stable and robust. I'm really hoping that it is.

Anyway, I've been reading the documentation and I cannot seem to be able to figure out how to start off with a simple project. Is there a download somewhere that includes a simple Visual Studio (2013) C# solution that lets me build the entire OhNet project without having to create my own C# project or solution ?

As I understand it, I need to build the OhNet project in order to create the ohnet.dll. Then, I need to create some .xml file that contains specs that I can use in the "OhNetGen.exe" command line arguments so that I can build a control point or a specific UPnP device.

Is there a document that is specific to C# and Visual Studio that covers the above and gets deeper into detail as to what needs to go into the .xml file to do various things?

I am implementing an emulator that will simulate hardware. It will need to have services, eventing, and icons, as well as the standard UPnP discovery. I assume that the OhNetGet.exe when used correctly with the appropriate .xml file will generate the code I need to build to implement the above UPnP Device. I also assume there will be code stubs in place for me to implement the various services, events, and images (icons).

If somebody has been through the c# process and can throw me a few tips, I would really appreciate it. I'm just having a bit of trouble understanding how to put this all together. I think I have most of the pieces, but it's as though I'm in the Advanced class and I never took the Introduction course.. Just a bit confused.

Thanks so much for your help on this.
Find all posts by this user
05-08-2014, 07:57 AM
Post: #2
RE: C# Implementation Guide
Welcome to the forums Curtis.

There isn't a solution file for Visual Studio - we normally just build from the command line. If you open a Visual Studio Command Prompt, you just need to cd to your ohNet directory then run make.

If you want to build only code required for C# apps, run make

We don't have any specific docs for how to describe a new service but do support the style of service definition used in the docs bundle from the UPnP forum. See the contents of ohnet\OpenHome\Net\Service\Upnp\OpenHome or ohnet\OpenHome\Net\Service\Upnp\Upnp for examples of the two formats supported by OhNetGen.

For information on how to use the new services you create in an application, see the overview docs at

Test code for the ohNet C# bindings also provides a useful reference. This is available in ohnet\OpenHome\Net\Bindings\Cs\ControlPoint\Tests and ohnet\OpenHome\Net\Bindings\Cs\Device\Tests.

Hopefully that's enough to get you started. Let us know how you get on.
Find all posts by this user
16-09-2014, 10:26 AM (This post was last modified: 16-09-2014 10:26 AM by irag12.)
Post: #3
RE: C# Implementation Guide
Perfect... thanks for this tip! Appreciate your response.

Find all posts by this user

Forum Jump: