Using open source projects involve some licensing considerations, which we discuss below. Once you have a basic understanding of licensing, you can start looking around for suitable projects!
Open Source Licensing
A license is permission granted by a copyright holder to others to allow them to reproduce or distribute a work. It’s a means by which the copyright holder can allow others to have some rights when it comes to using the work, without actually assigning the copyright to those other users.
Although there’s a huge variety of licenses that could be used to manage the rights associated with open source projects, most tend to employ one of the Open Source Initiative, or OSI, approved licenses.
The GNU GPL (General Public License) is the most widely used of these licenses, but it’s often shunned by those producing commercial products. GPL is often called a viral license as it requires that any changes that developers make to the code must be released to the public. If you wish to use GPL in your code, I recommend that you consult your company lawyer, or avoid it unless your company wishes to make its code public.
A range of licenses, such as the LGPL, Apache, MIT, and New BSD licenses, do not place any such “give back” restrictions on code usage, which explains why they tend to be very popular among corporate users and those developing proprietary software.
Most of these licenses allow any and all use of the code (commercial or otherwise), as long as a set of requirements is met. Typically, the developers are required to keep the copyright notice in the code, and provide proper attribution.
Finding Open Source .NET Resources
If you think you’d like to use an open source library to solve a particular problem, where do you go to find that code? The Google search engine is a good starting point, though you may spend a lot of time sifting through commercial products looking for the open source options. In my experience, though, open source projects tend to rank well in the search results because the community involvement in their development usually results in a lot of links to the project.
Another great place to look is SourceForge—the single largest repository of open source code. For Microsoft-specific technologies, CodePlex is an excellent resource. Google also recently deployed an open source code hosting service called Google Code.
Recommended Open Source Projects
A huge number of useful open source libraries exist out there in the wild. In fact, we’ll cover several of them in this very book. But for easy reference, the list below includes a few open source projects with which the authors of this book are familiar.
Log4Net (http://logging.apache.org/log4net/)
Log4Net is a port of the popular Log4J logging framework for Java. Log4Net is extremely extensible, allowing logging to a variety of output targets. It’s also extremely fast, as performance is a major consideration for the Log4Net team.
NUnit (http://www.nunit.org/) and MbUnit (http://www.mbunit.com/)
NUnit is a port of the JUnit unit-testing framework for Java. NUnit is useful for automatic regression testing and Test Driven Development. MbUnit deserves special mention for the innovations it introduces to unit testing such as row-based testing, combinatorial testing, and transactional rollbacks.
NHibernate (http://www.nhibernate.org/)
NHibernate is a port of the Hibernate OR/M mapping tool for Java (are you noticing a theme here?). NHibernate provides mapping capabilities between your objects and the underlying database store. It dynamically generates the SQL necessary to load and persist your objects.
SubSonic (http://subsonicproject.com/)
SubSonic is a lightweight data access layer and code generator. It’s often called OR/M Light, as it’s designed to improve a developer’s productivity by being really quick and easy to use. We’ve included an overview of SubSonic in Chapter 17 “Advanced Topics”.
DotNetNuke (http://www.dotnetnuke.com/)
DotNetNuke—DNN for short—is a free, open source, web portal application that has a very large and active community of contributors and supporters. Many companies have formed solely to build web sites on DNN, and sell custom modules and support.
FCKeditor (http://www.fckeditor.net/)
FCKeditor is an open source rich text editor for web sites that works with multiple web platforms, including ASP.NET. As a user, authoring content using FCKeditor is very similar to using Microsoft Word.