Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Class Library


  • Please log in to reply
3 replies to this topic

#1 Terry Massey

Terry Massey

    Advanced Member

  • Members
  • PipPipPip
  • 77 posts
  • LocationPekin, IL

Posted 28 January 2011 - 07:30 AM

All, ok so I am using the mini but I don't think this is really a mini related problem. I think it is more of a .net micro framework, Visual Studio or maybe even resharper issue. I have a class library that I have developed for my windows WPF application that uses very simple system types nothing special about it. I did have INotifyProperty change on the properties but I removed that. and the references to everything but system. all works great in windows. So I reference the lib in my netuindomini project and it says the reference wont work because it is using the wrong framework. Which makes sense since it is targeting .net 4. is there a way to create a shared lib that can be used for both .net 4 and the micro framework. the goal is to create a simple set of classes and interfaces for defining my data packet format and assemblers and disassemblers. That way I don't have to write two sets of classes to the the same thing or If I make a bug fix in one not have to remember to make the change in another lib. See my project talks wirelessly using XBee wireless modules and has a IP style data packet structure since there are many addresses for sensors and the types of data being variable in length. I have a structure that supports communicating all of this. but I really don't want two implementations or even three since I will have to code some in SPIN or PASM for the Micro controllers. thanks, Terry
Thanks,
Terry Massey

#2 Mark H

Mark H

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationPerth, Western Australia

Posted 28 January 2011 - 07:47 AM

Just create your library targeting the microframework, then use it with the full framework. The micro framework is less featured, hence why you target that. There is a warning on the reference in your project, but just ignore that. The other option is to have two project files in the same folder - using the same class files. One targets net4, one targets netmf.

#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 January 2011 - 05:58 PM

Hi Terry, To add to what Mark mentioned, we build a number of libraries targeting four .NET frameworks (.NET, .NET Compact Framework, .NET Micro Framework, and Silverlight). We usually just create a project file for each framework (and then just recompile them when needed), but we've also made .NET Compact Framework assemblies that can be used seamlessly on the desktop. I've never actually personally tried to use a .NET Micro Framework assembly (the .DLL, not .PE) on the desktop, but it looks like Mark H has explored that path :) Chris

#4 Mark H

Mark H

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationPerth, Western Australia

Posted 29 January 2011 - 02:40 AM

I built a library for working with Aerocomm modules on netmf, and in testing used a PC to talk to the NetMF device via the radio - 3 projects in the solution, 1 for netmf, one for the rf library, one for the PC. I set dual startup projects, with the netmf coming first. Once the netmf app is deployed, it starts the PC app. Whilst debugging, if you pause one project (or hit a breakpoint/exception) the other project also pauses which means you dont get a flood of serial data coming through unprocessed.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.