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

StringBuilder class unavailable


  • Please log in to reply
8 replies to this topic

#1 hari

hari

    Advanced Member

  • Members
  • PipPipPip
  • 131 posts

Posted 21 September 2010 - 01:14 AM

According to Microsoft, .NET Micro Framework includes StringBuilder class in System.Ext.Text.
http://msdn.microsof...y/ee436407.aspx

However, System.Ext.Text is not listed when I try to add it as a reference in my project. Is it because the Netduino implementation of .NET Micro Framework does not have it? If so, what's the best way to get a definitive list of classes and docs of what's really available? Thanks.

PS: Adding mfdpwsextensions.dll does not help either :-(

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 21 September 2010 - 01:47 AM

Hi hari, .NET Micro Framework doesn't have a StringBuilder in its core, so we've made one in managed code. See this post for more details: http://forums.netdui...ch__1#entry1096 Chris

#3 hari

hari

    Advanced Member

  • Members
  • PipPipPip
  • 131 posts

Posted 21 September 2010 - 01:59 AM

Hi hari,

.NET Micro Framework doesn't have a StringBuilder in its core, so we've made one in managed code.

See this post for more details:
http://forums.netdui...ch__1#entry1096

Chris

Thanks Chris! That'll do.
So the MS documentation is wrong?! that page specifically says: "Available in the .NET Micro Framework versions 2.5, 3.0, 4.0, and 4.1."

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 21 September 2010 - 02:02 AM

Thanks Chris! That'll do.
So the MS documentation is wrong?! that page specifically says: "Available in the .NET Micro Framework versions 2.5, 3.0, 4.0, and 4.1."


I'd have to double-check, but I think it's part of the optional DPWS libraries...which are much too large for a smaller device like the Netduino. Someone will correct me if I'm wrong on that... :)

#5 phantomtypist

phantomtypist

    Advanced Member

  • Members
  • PipPipPip
  • 142 posts
  • LocationNew York, NY

Posted 21 September 2010 - 02:57 AM

I'd have to double-check, but I think it's part of the optional DPWS libraries...which are much too large for a smaller device like the Netduino. Someone will correct me if I'm wrong on that... :)


Yes, it's part of DPWS.

#6 Crispin

Crispin

    Advanced Member

  • Members
  • PipPipPip
  • 65 posts
  • LocationLondon, England, Earth

Posted 21 September 2010 - 07:03 AM

Why not just concatenate yourself? On a PC with more free CPU time than you know what to do with, using something like string builder is ok. On something like Netduino where both CPU and memory are limited, what is the advantage of using string builder class other than "it's easy for me to read and write"? If you want to append within a string, fine, but for normal concatenation? With the added overhead of csharp and "common" ways of writing code, Netduino could be seen as slow when it's not really the hardware's fault.
--
Take a seat, I'll be right with you.

#7 hari

hari

    Advanced Member

  • Members
  • PipPipPip
  • 131 posts

Posted 21 September 2010 - 03:45 PM

Why not just concatenate yourself? On a PC with more free CPU time than you know what to do with, using something like string builder is ok. On something like Netduino where both CPU and memory are limited, what is the advantage of using string builder class other than "it's easy for me to read and write"?

If you want to append within a string, fine, but for normal concatenation?
With the added overhead of csharp and "common" ways of writing code, Netduino could be seen as slow when it's not really the hardware's fault.

Yes, I am appending to a string many-many times. I'm building a line out of characters received via SerialPort.DataReceived event, so on a slow input, I end up appending one character at a time as they arrive.

I decided to keep them in a simple byte[] array buffer and only copy into a string when I find a new line character.

Thanks for all the insights everyone.

#8 Crispin

Crispin

    Advanced Member

  • Members
  • PipPipPip
  • 65 posts
  • LocationLondon, England, Earth

Posted 21 September 2010 - 07:28 PM

Obviously if it's the best way, then use it ;)
--
Take a seat, I'll be right with you.

#9 Crispin

Crispin

    Advanced Member

  • Members
  • PipPipPip
  • 65 posts
  • LocationLondon, England, Earth

Posted 23 September 2010 - 01:29 PM

My point is answered here: http://forums.netdui..._2670#entry2670 14 minutes in, the question is asked. Interesting listen. /OT :blink:
--
Take a seat, I'll be right with you.




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.