Main Site Documentation

GHIElectronics.OSH.NETMF.Hardware - Using in code


#1

Another noob question: I am still trying to learn how to navigate and use classes in libraries that already exist. I find an example but then it takes a long time before I find the correct libraries (references) to add to the code.

Example:

This reference is added in my current project in Visual C#: GHIElectronics.OSH.NETMF.Hardware

And I am referring to the documentation here:
https://www.ghielectronics.com/downloads/NETMF/Library%20Documentation%20v4.2/OSHW/Index.html
Which is the documentation for library: GHI.OSHW.Hardware

I start getting confused here: the reference is OSH and the documentation is OSHW.

And in my code I am trying to use:
GHIElectronics.OSH.NETMF.Hardware.“etc.” but none of the classes listed in the documentation show up here.

Any guidance would be greatly appreciated.

Thanks again, Keith


#2

Where OSH came from? This was changed long time ago. Are you using a very old SDK?

Everything should be OSHW


#3

This is what shows in my add or remove programs list:

GHI .NET Gadgeteer SDK
GHI NETMF USB Drivers
GHI NETMF v4.1 SDK
GHI OSH NETMF v4.1 SDK
GHI OSHW NETMF v4.2 SDK
GHI Premium NETMF v4.2 SDK

and I am using Visual C# 2010 express

Should I uninstall GHI OSH NETMF v4.1 SDK ?

Thanks


#4

Ahhh, that was a HUGE clue for me.

In Visual C# Express, Under Project properties, Application, the value of Target framework was set to ‘.NET Micro Framework 4.1’ because I am still working with a FEZ Panda I.

Changing the Target framework from 4.1 to 4.2 .NET Micro Framework changes the list of references that are available in code.

And the light gets a little brighter :slight_smile:

Thanks, Keith


#5

If I may I have a related follow up question:

System.Net.HttpWebRequest exists in System[4.0.0.0]

I am using System and System.Net in code.

System is also referenced in the project.

The target framework is set to .NET Micro Framework 4.2. (this may not relate to this issue?)

However, I get the error message the the type or namespace name HttpWebRequest could not be found.

I have also tried System.Net.HttpWebRequest and this does not resolve issue either.

How do I resolve this?

Thanks again.


#6

Yes, the object browser is where I found the information I posted.

HttpWebRequest shows in: System[2.0.0.0] and System[4.0.0.0]

but not in System[4.2.0.0]

So I am still confused.


#7

Ok, that worked.

But why? How did you know to do that?

I really need to connect the dots here and really appreciate the help.

Thanks, Keith


#8

Member of


#9

OK, so let me get this straight, you’re using a Fez Panda? If so, then you do NOT need (and in fact, cannot use) the Open Source Hardware components. The Panda is a PREMIUM 4.1 device, so you only need the PREMIUM libraries. If you try to use the 4.1 OSHW libraries, you’ll get into trouble.

The 4.1 library documentation is http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation%20v4.1/Index.html and you will find that everything in the OSHW, and more, is available there.


#10

Okay, so now I understand better how the versions and libraries relate.

I uninstalled .netmf tools, OSH, and Gadgiteer SDK’s and some SEED stuff which removed a lot of clutter from the add libraries view.

All I have now listed are Microsoft .NET Micro Framework and GHIElectronics assemblies.

All the comments have helped clarify the matter.

Thanks for the help.

Keith