Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting started .net c#
04-09-2013, 10:30 PM
Post: #1
Getting started .net c#
Hi i'm a .net c# developer and i'm totally new to upnp.

I started looking at it because of the windows 7 "play to" feature that seamlessly let you send media content to other devices on the network.

I have a loot of cool ideas for small apps and the like Smile
But it has been almost impossible to find anything out of the box. I have been looking many places and found many different things, most is created in c++ and a few wrappers might exist.... any way I found my way to ohNet and it seems like it might answer all my prayers.

I just don't know how to get started. There seams to be no tutorials or examples to start out with. I found some references to:
ohNet/OpenHome/Net/Bindings/Cs/ControlPoint/Test/
But when you download the "ohNet-1.0.824-Windows-x64-Release" it is not in there.
I'm thinking that I have to build it somehow, using c++, but it's been 10 years since I looked at a single line of c++ code so I simply don't remember how to build and stuff.
Is there any where I can find a small simple how to, to get me started?
As I under stand I just need a reference to ohNet.dll and ohNet.net.dll.
If I then had some example code I could get going Smile
So where/how can i find the c# example code?
If i need to do some c++ building maybe a small guide in how to do that using windows 7 and VS2012.

Thanks
Johnnie
Find all posts by this user
05-09-2013, 08:17 AM
Post: #2
RE: Getting started .net c#
(04-09-2013 10:30 PM)HYgTA Wrote:  I just don't know how to get started. There seams to be no tutorials or examples to start out with. I found some references to:
ohNet/OpenHome/Net/Bindings/Cs/ControlPoint/Test/
But when you download the "ohNet-1.0.824-Windows-x64-Release" it is not in there.
...
Is there any where I can find a small simple how to, to get me started?
As I under stand I just need a reference to ohNet.dll and ohNet.net.dll.
If I then had some example code I could get going Smile
So where/how can i find the c# example code?

Have you looked at our wiki page? This should take you through how to fetch and build the code. After that, have a glance through the ControlPoint stack overview document then look at the C# tests in the code.

This will hopefully cover all your questions. Please feel free to come back with more questions if you're still unsure about anything however.
Find all posts by this user
10-09-2013, 11:23 AM
Post: #3
RE: Getting started .net c#
Hi thanks for your quick response and sorry for my late response. Smile
Yes I saw the wiki page. There is not a lot of info there Smile
It was from the wiki page I found the binaries.
The problem as I described was that the binaries did not include any example code. And I was wondering if I had to build something in c++ in order to get the example code that is mentioned in some other posts. Supposedly there should be some c# example stuff in ohnet\OpenHome\Net\Bindings\Cs
I finally decided to try that gitHub thing Smile
So I downloaded gitHub for windows and succeeded in getting the code down using gitHub. That gave me the ohnet\OpenHome\Net\Bindings\Cs that I was looking for.
I then proceeded to setup a small test.
So I created a new VS solution in VS 2012, and copied ohnet\OpenHome\Net\Bindings\Cs\ControlPoint\Tests\TestBasicCp.cs into the solution.
I of course could not build it as I had no reference to the ohnet library. So How to get the reference. I read in some post that the only reference needed is ohnet.dll and ohnet.net.dll so my plan was to ad those as references.
There are no dll’s in the gitHub files so I was thinking that I could get the dll’s from the binaries that I downloaded from the wiki. My first idea was to go to ohNet.net-AnyPlatform-Release as this seems to be the most finish version, but that only included the ohNet.net.dll Sad
So I tried the ohNet-1.0.824-Windows-x86-Debug (I also tried the x64 version) and there it was.
I now had the two dll’s I guess I need.

TestBasicCp.cs has two includes:
using OpenHome.Net.ControlPoint;
using OpenHome.Net.ControlPoint.Proxies;

The first include was ok when I added ohNet.net.dll
The problem now is that I am not able to ad ohNet.dll
It says that I should make sure that ohNet.dll is a valid assembly or COM component.
This mean that I am stuck … Can anyone help?
It would be so much easier if I could download a VS solution file with everything set up, run the tests and get going on my own project. Smile
Find all posts by this user
12-09-2013, 10:21 AM
Post: #4
RE: Getting started .net c#
Hi,

I'm afraid simonc is away for a couple of weeks, so I'll try to do what I can to help. You don't need to add ohNet.dll as a referenced assembly. You just need to make sure that it's present in the same directory as your application when you run it. One way to do that is to add it to your project and set it to be copied to the output folder.

You're right, it would be much better if we had a grab-and-go example solution for all the different bindings.

Regards,

Andrew.
Visit this user's website Find all posts by this user


Forum Jump: