60+ .NET libraries every developer should know about.

February 16, 201058 Comments
Facebook Twitter Pinterest Plusone

Every good developer knows never to re-invent the wheel, especially if there is software out there that has been tested by others, and has an established track record. As a developer using the .NET framework I’ve found some of these libraries invaluable, so I’m sharing them for some of the other dev’s out there with a brief outline of how to use.

Yedda Twitter Library.

URL: http://devblog.yedda.com/index.php/twitter-c-library/

I’ve used this on a number of very simple twitter projects, where I’ve just needed to send an update. As the site says its more of a wrapper for the Twitter API than an actual library, but none the less its an easy way to integrate with the service via a drop in dll. Here’s how to use it.

  1. Dim objYedda As New Yedda.Twitter
  2. Dim status as String
  3. Dim strTwitterUser as String = “username”
  4. Dim strTwitterPassword as String = “password”
  5. status = “Hello World”
  6. objYedda.Update(strTwitterUser, strTwitterPassword, strStatus, Yedda.Twitter.OutputFormatType.RSS)

This small section of code will update your Twitter stream (provided you have a reference to the DLL), and your username and password correct.

FileHelpers Library

URL: http://filehelpers.sourceforge.net/

The FileHelpers library was created to stop developers from continuing to parse CSV. If you are doing any kind of importing and exporting within your application using the CSV format to get data in or out, look no further.

You can strong type your flat file simply by coding up a class that maps a data type to each record. This way data consistency, and import / export reliability can be tightened up on quite a bit.  Writing out to a new file is also pretty easy once you’ve created your base classes defining the structure. Great little library for your toolkit.

First define the structure class…

  1. <DelimitedRecord(“,”)>_
  2. Public Class Product
  3. Public ProductName As String
  4. Public ProductCode As Integer
  5. etc..
  6. End Class

Add a reference to the FileHelper.dll, and read from the file , casting to a array of product objects.

  1. Dim engine As New FileHelperEngine(GetType(Product))
  2. Dim myProduct As Product() = DirectCast(engine.ReadFile(“product.txt”), Product())

Perform actions on the array of Products.

  1. For Each pro As Product In myProduct)
  2. Response.Write(pro.ProductName)
  3. Next

Elmah

URL: http://code.google.com/p/elmah/

Elmah stands for error logging module and handlers. It is a completely pluggable in system for error handling within your .NET app. It catches bot thrown and unhandled exceptions across the scope of your app, logs them, and allows you to browse the full stack trace, all without exposing the error to the users of your application. That’s useful for a number of reasons. Firstly you aren’t getting the performance hit of using debug=true within your application (which by the way you should never be using in a production environment anyway) – and it means you can still get to the bottom of little blips as and if they happen. Coolio.

Elmah works as an HTTP module, so it takes little or no effort to deploy on any project. Just configure a few bits and bobs, and away it goes. All of the configuration is performed in the configuration file – just telling it whether you want your errors logged in a database, in memory or in a txt file is as simple as changing some web config parameters. You can even grab recent errors via RSS and get notified like that.

Log4Net

URL: http://logging.apache.org/log4net/

Following in the same vein as Elmah – Log4Net is a port of the well known logging framework for Java log4J. Whilst Elmah concentrates on exceptions that are thrown, Log4Net allows a much more granualar approach to program debugging.

With log4net it is possible to enable logging at runtime without modifying the original application binary and without incurring a high performance cost. Multiple “levels” of logging can be set within your program as well, and so you can determine quickly where “fatal” errors occur, and where “warnings” occur that can be ignored in the safe running of your application.

Log4Net enables all of these things whilst providing the same level of control over the logging format and location as Elmah. You can decide whether you’d like your debug message sent  to a database, a text file, or indeed a TCP port. Different “Appenders” define where and how to send the messages, so if there’s somewhere else you’d like to see errors, you can easily write your own appender to perform this. Again, the appenders are defined in the web.config file.

  1. Imports log4net
  2. Imports log4net.Config
  3. Private Shared log As log4net.ILog
  4. Public Sub Page_Load(Byval s as Object, Byval e As EventArgs) Handles MyBase.Load
  5. log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)
  6. BasicConfigurator.Configure()
  7. log.Debug(“Debug Message”)
  8. log.Warn(“Warning Message”)
  9. log.Fatal(“Fatal Message”)
  10. End Sub

Enterprise DT FTP Library

URL: http://www.enterprisedt.com/products/edtftpnet/overview.html

Enterprise DT is a great little FTP library, that performs all the needful without you getting your hands too dirty. It works with both web and offline applications, and again is a port of a Java library. I’ve used it for automating FTP tasks at the command line, sending photos between two sites automatically via FTP, and for sending feeds to google. It’s really easy to use, and saves you from having to write your own FTP operations. Fire it up, pass some usernames and passwords to it, and away we go. As below:

  1. Dim ftp as FTPConnection = new FTPConnection()
  2. ftpConnection.ServerAddress = “myserver”
  3. ftpConnection.UserName = userName
  4. ftpConnection.Password = password
  5. ftpConnection.Connect()
  6. ftpConnection.UploadFile(localFilePath, remoteFileName)
  7. ftp.Close()

HtmlAgilityPack

URL: http://www.codeplex.com/htmlagilitypack

The Html Agility Pack is a library for parsing HTML. It is particularly useful if you are doing any kind of scraping work, with the main object of the software to transform real world HTML into structured and parseable DOM structure. It supports plain XPATH or XSLT syntax for traversing through HTML, making loops and extraction of text a breeze.  Knowing these two technologies isn’t a pre-requisite to using it, but it sure as heck helps.  You don’t have to setup the WebRequest or anything to grab remote files, which is handy – as you’ll see from the example.

  1. Dim hw As New HtmlAgilityPack.HtmlWeb
  2. Dim doc As HtmlAgilityPack.HtmlDocument
  3. doc = hw.Load(“http://www.webdistortion.com”)
  4. For Each s As HtmlAgilityPack.HtmlNode In doc.DocumentNode.SelectNodes(“//a[@href]“)
  5. Dim att As HtmlAgilityPack.HtmlAttribute = s.Attributes(“href”)
  6. Response.Write(att.Value & vbCrLf)
  7. Next

OpenAuth Library

URL: http://code.google.com/p/oauth-dot-net/

Open Auth is slowly becoming the norm, with web apps many preferring its usage over other less secure forms of authentication. This library is a .NET implementation of OpenAuth, and is mighty useful if you need to get up and running quickly. You are sure to run into a web service that needs you to auth via it. Google, Yahoo, Netflix and Twitter all support OpenAuth to interact with their service. The code needed for open auth is more extensive than some of the other bits and bobs, and has been better explained by others. Some of these links are worth a look.

  • Shannon Whitley offers this example: Code | Live demo
  • Daniel Crenna’s examples:

OAuth Specification

The OAuth Workflow

OAuth Walkthrough

Microsoft AntiXSS library

URL: http://bit.ly/toCrt

This is one of the security packs that MS have released to help .NET developers write better, more secure code. Essentially it is an encoding library designed to help protect ASP.NET web-based applications from XSS attacks, and works on the principals of inclusion (white-listing) to accept valid characters. I’ve used it successfully on a couple of projects, and some of the pre-written methods have been rigourously tested by leading security experts.

  1. Microsoft.Security.Application.AntiXss.HtmlEncode(strNotrust)
  2. Microsoft.Security.Application.AntiXss.JavaScriptEncode(strNotrust)

C5 Collections – Collections for .NET

URL: http://www.itu.dk/research/c5/

C5 provides functionality and data structures not provided by the standard .Net System.Collections.Generic namespace, such as persistent tree data structures, heap based priority queues, hash indexed array lists and linked lists, and events on collection changes. Also, it is more comprehensive than collection class libraries on other similar platforms, such as Java. Unlike many other collection class libraries, C5 is designed with a strict policy of supporting “code to interface not implementation”. Definitely worth a look.

Honourable Mentions

Dependency Injection/Inversion of Control

Logging

Compression

Ajax

Data Mapper

ORM

Charting/Graphics

PDF Creators/Generators

Unit Testing/Mocking

Automated Web Testing

URL Rewriting

Controls

Unclassified

Filed in: Programming
Tagged with:

About the Author ()

Paul is a regular 30 year old web bloke / programmer with a penchant for online marketing. This blog is a personal outlet, with an eclectic mix of articles.

Comments (58)

Trackback URL | Comments RSS Feed

Sites That Link to this Post

  1. 60+ bibliotek .NET, które każdy powinien znać - develway.pl | February 17, 2010
  2. +60 librerias .net que todo desarrollador debería conocer « Hablando de web Desarrollo ágil de web en php, asp.net, javascript… | February 17, 2010
  3. links for 2010-02-17 | LaptopHeaven's Blog | February 18, 2010
  4. links for 2010-02-18 | sashidhar.com | February 18, 2010
  5. 60+ .NET libraries every developer should know about « Wasim Farhat Blog | February 18, 2010
  6. Bookmarks for February 17th through February 18th | The Wahoffs.com | February 18, 2010
  7. Free Developer Tools - Kartones Blog | February 19, 2010
  8. Weekly Link Post 133 « Rhonda Tipton’s WebLog | February 19, 2010
  9. 60 outils .NET à connaître « Blog de Denis Voituron | February 19, 2010
  10. Interesting Finds: 2010 02.20 - gOODiDEA.NET | February 20, 2010
  11. הבלוגים של אורט » ארכיון » links for 2010-02-20 | February 21, 2010
  12. LinXs 2010-02-22 | Maxim's blog | February 22, 2010
  13. 60+ .NET libraries every developer should know about. | Listaurus | February 22, 2010
  14. links for 2010-02-23 | The Gryphin Experience | February 23, 2010
  15. Librerie e Toolkit per lo sviluppo .NET | Dubito.it Blog | February 26, 2010
  16. 60+ .NET libraries every developer should know about. « Vincent Leung .NET Tech Clips | February 27, 2010
  17. 60 librairies que tout développeur .NET doit connaitre | Krux | February 27, 2010
  18. Полезные ссылки - Блог Краковецкого Александра - Microsoft User Group Винница | March 1, 2010
  19. TWC9: MIX10, Tweets from Your TiVO, Touch UI Gesture Icons and More — Global Nerdy | March 2, 2010
  20. Tune Up Your PC » Post Topic » TWC9: MIX10, Tweets from Your TiVO, Touch UI Gesture Icons and More | March 2, 2010
  21. BlogMouth : Social Media Top Links February 2010: Google Buzz Privacy Debacle | March 2, 2010
  22. links for 2010-03-18 - Craig's Blog | March 18, 2010
  23. links for 2010-03-28 - fractalnavel | March 28, 2010
  1. Paul Anthony says:

    Hi John,

    Looks like an interesting little project. Will definitely check it out, thanks for the comment.

    Paul

  2. Will says:

    I really dislike the FileHelpers library. I used it for parsing a CSV file and it actually uses the order of fields defined in a type to map colums in a CSV file to that type. I’m not sure if the common type system specifies that field definition order is significant or if its up to the compiler to decide the final order of fields in a type, but it reeks of code smell and magic.

  3. Dennis says:

    Hi there,

    you might also want to check out our .NET logging tool SmartInspect:

    http://www.gurock.com/smartinspect/

    Thanks,
    Dennis

  4. Paul says:

    Hi Paul, great post. Love some of these already, NLog works perfectly for my projects and it looks like FileHelper is just what I need to parse csv’s.

  5. SM says:

    Great collection. All properly written. Thanks

  6. T-Rex says:

    Found several libs in this list which I didn’t know. Thanks for sharing :)

  7. For Unit Testing/Mocking, you should check Visual T#: a programming language (C# compatible) to write better tests in a simpler manner.

  8. Nizar says:

    Very helpful! Thanks for sharing!

  9. Arthur says:

    The most concise and yet I think complete list of libraries, thank you Paul!

  10. Sri says:

    Agree with SM – great collection. However why not add Fluent NHibernate under ORM? Did you drop it as is a wrapper for NHibernate?

  11. Paul Anthony says:

    You are all most welcome, thanks for the feedback. Any of the bits and bobs I’ve missed thus far, I’ll add in at a later stage.

    Paul.

  12. David says:

    SubSonic should up there too.

  13. Maybe not libraries that every dev should know but… TweetSharp is very useful for twitter. And for Amazon S3 I use ThreeSharp.

  14. “OpenAuth” is an AOL-proprietary protocol. It is NOT the same thing as OAuth. Please correct your references to OpenAuth to be just OAuth.

  15. Frank Adam says:

    Zodiac.NET is a good library as well:
    http://www.mentor-logic.com/index.php/products/components/zodiacnet

    I’ve tried it in a couple of projects and it saved me alot of time.

  16. Sutasu says:

    Great collection! Thanks.

  17. Antoine says:

    It is much more than a library, but I suggest you look at the product CodeFluent (www.codefluent.com). Moreover, it contains a runtime with many utilities classes (helpers).

  18. Roboblob says:

    You forgot FluentDateTime library that ports Ruby’s elegant DateTime fluent calls

    http://www.codeplex.com/fluentdatetime

  19. Zeus says:

    Hiya, great article!

    One point, Facebook.NET library has not been updated since 2008.

    You would be better off recommending http://www.codeplex.com/FacebookToolkit
    which looks like it’s been kept up to date, with releases this year.

  20. Paul Anthony says:

    Hey Zeus -

    thanks for pointing that out. Looks like the project that *should* have got the link.

    Regards,
    Paul.

  21. tobsen says:

    Please remove all logging libs in favor of the small logging abstraction layer “common logging” http://netcommon.sourceforge.net/ so people can decide via configuration which logger to use instead of hard wiring their application to a specific logger.

  22. Paul Anthony says:

    Hi Tobsen,

    I’ll not be removing any of the logging dll’s – as I trust the developers reading this post to make their own choices about their application architecture. but thanks for your input – the common library for logging looks interesting to say the least.

    Paul

  23. Nk54 says:

    Thanks a lot. I flove exceptioneer ! Very nice

  24. Prospa says:

    Just wonder why reflector is not in this list!

  25. Paul Anthony says:

    @Propspa – to my knowledge reflector is a tool, not a dll.

  26. Eric says:

    EntitySpaces is the easiest to use .net ORM I’ve been able to find. Check it out:

    http://www.entityspaces.net

  27. Neil says:

    Good list, a couple new to me which I’ll look at.

    +1 for FluentNHibernate
    +1 for CommonLogging

    A few which I didn’t spot, but that I’d always recommend (apologies if they are there):

    OpenRasta (REST enabling framework – http://trac.caffeine-it.com/openrasta)
    MVC Contrib (http://www.codeplex.com/MVCContrib)
    SpecFlow (for testing – http://specflow.org/)
    Cuke4Nuke (also for testing – http://wiki.github.com/richardlawrence/Cuke4Nuke/)

  28. Nitin says:

    Awesome list of libraries – quite a few to check out this weekend :). Cheers.

  29. unit testing says:

    ohhh,nice list buddy!!!
    i’ll have to do some job right now,it seems that you have done not bad job!
    thanks again.

  30. @Propspa – to my knowledge reflector is a tool, not a dll.

  31. Martín says:

    few which I didn’t spot, but that I’d always recommend !!!!!

  32. Steve Martin says:

    I would wholeheartedly recommend SolrNet be added to the list of hallowed libraries. It’s an enterprise class IR server that sits on top of Lucene.

  33. brakes says:

    Thanks for the recommendation Steve. I was looking for a simple program to use with my libraries thanks man

Leave a Reply

Back to Top