What are some open source C# projects I can download that implement many best-practices and have a relatively high code quality?
Please accompany your answer with some of the reasons you consider the code is of high quality.
Scott Hanselman's The Weekly Source Code [1] series is a nice read, he got 30+ episodes already and his comment is posted up along with each post as well.
[1] http://www.hanselman.com/blog/CategoryView.aspx?category=Source+CodeI'm sorry that my post won't answer on your question, but I just want to add my 2 cents.
I doubt you can find any project with extremely high quality of code :)
I would be happy to know if I'm wrong, but I believe that people answered on this questions name applications because of their quality for end-users not because they written in high quality code.
Real-world projects being created to solve problems not to show off beautiful code.
You will be amazed if you take a look at metrics of some well-known projects.
I don't remember exact link, but there was a NDepend analysis of popular projects such as Paint.NET. Results were, let's say quite disappointing, but those projects are still good at what they do.
I saw millions of lines of code in commercial and open-source projects. I didn't see any project with extremely high quality but those project solved their task.
High quality code is somewhat subjective and even mystical matter. I think it would be much more useful to seek for good solution for a specific problem.
For example, project X has some really good code to solve Y, but it sucks in implementation of Z.
To make my post less off-topic, I can recommend you to take a look at code written by Microsoft Patterns & Practices [1] team.
For example:
These projects are being written by very proficient developers, and they are intended specifically to teach how to come up with good solutions for some problems.
But even those projects suck terribly in implementation of some things :)
[1] http://msdn.microsoft.com/en-us/practices/default.aspxHere are some quality/structuring/changes analysis I did with NDepend [1]
.NET Fx 4.0 beta1 vs 3.5 SP1
[2]
SharpDevelop
[3]
CruiseControl.NET
[4]
NUnit
[5]
Mono vs .NET Fx
[6]
Silverlight vs. .NET Fx
[7]
NHibernate
[8]
.NET 3.5 SP1 vs 3.5
[9]
I found the source for ASP.NET MVC [1] to be a worthwhile read. At the time of writing, the latest source is avaliable to download on the preview 5 release page [2].
[1] http://www.asp.net/mvc/NHibernate [1], rhino mocks [2], the castle project [3].
[1] http://www.hibernate.org/428.htmlYou can look directly at the .Net Framwork source available here: http://referencesource.microsoft.com/netframework.aspx
The XNA Creators Club [1] has some quite nice, open source code - even if you aren't interested in the XNA aspect. Each code sample is small enough to wrap your head around, and often have a very good design.
[1] http://creators.xna.com/education/catalog/I would strongly recommend taking a look at Community Server [1]. It is not an "Open Source" product per-se, but they provide a free Personal License and you can download the source for the entire system to muddle with.
[1] http://www.communityserver.orgCheck out Rotor [1] and CSLA [2]
Rotor is a shared source implementation (from MS) of portions of the .Net framework. CSLA is a nice Business Object framework for creating rich client and web apps.
[1] http://msdn.microsoft.com/en-us/library/ms973880.aspxI would nominate the enterprise library which I maintain. Although it is virtually unknown :), it has been used on large project and performed really well. It is also FxCop compliant. It's called SixPack library [1].
[1] http://code.google.com/p/sixpack-library/I'm surprised no one mentioned Sharp Architecture [1]
I'm surprised no one mentioned Ninject [1] or Siesta [2] yet, Nate Kohari has impeccable taste in writing source code
[1] http://ninject.org/I would recommend you to take a look at xUnit [1] for example. Scott Hanselman has a serios of posts where he recommends some source code to take a look at (usually managed code written in C#): source code category posts [2]
[1] http://www.codeplex.com/xunitHave a look at mono [1] and Paint.Net [2]
[1] http://www.go-mono.com/mono-downloads/download.html/I think Mono [1] could be a great place since the framework is built in C# itself. It might not fit your complexiity requoirement though
[1] http://www.mono-project.com/Main_PageIf you want to see true art I'd recommend you to download Boo and check out. I recognize Rodrigo B. De Olivias to be probably among the best handful of men alive today in regards to code and quality...
When that's said, I'd definitely give Ra-Ajax [1] a look too. I'm the creator of that stuff and there are very many places in there which I consider to have the "quality of Mona Lisa"...
To those saying that code quality and "pragmatism" doesn't necessarily go hand in hand, I would just like to say that you're wrong...!
Usefulness in most circumstances grows parallel in a one-to-one relationship with code code quality...!
Also often to determine code quality you can often count the number of lines of code, in general. The more complex the solution solved with less lines of code - the better the quality (normally)
[1] http://ra-ajax.orgWhat about DataObjects.Net [1]? It's open-source commercial ORM + In-memory object database, seems to be quite interesting.
[1] http://dataobjects.net/Phalanger [1], a PHP to .NET compiler has some very high quality, well documented code.
[1] http://phalanger.codeplex.com/SourceControl/ListDownloadableCommits.aspxPcap.Net [1].
Documented. High code coverage. Low warnings (including Code Analysis).
[1] http://pcapdotnet.codeplex.comAnother suggestion, if you're interested in medical imaging software is ClearCanvas [1]. They've developed an open source medical imaging viewer, archive, and a radiology information system. More details and how to access the source can be found on the site.
They've developed an application framework for developing .NET desktop apps, which is used to develop the viewer and information system. There's also developer documentation to get you started for the viewer, if you'd want to customize it yourself.
[1] http://www.clearcanvas.caJohn and Marc's MiscUtil [1] is worth a look, the code is well commented and organized. It includes a large amount of tests.
[1] http://www.yoda.arachsys.com/csharp/miscutil/Personally, I've been amazed at what the people at the Kigg project have put together:
http://kigg.codeplex.com/Wikipage
Really some amazing stuff to see as to how they tackle building a robust, modern C# app.
MediaPortal [1]. Individual sections of code are quite good, unfortunately it is not as cohesive as one might hope. There is an enormous amount of C# code covering everything from DB manipulation and XML manipulation to multimedia directshow programming and directx rendering.
[1] http://www.osalt.com/mediaportalforums.agbotting.net in the release forum go to svns, I know the guy who coded that it's a bot and maphack for a video game called Diablo II, that him and a friend wrote themselfs. I believe it's of pretty good quality, and it's not very huge.
Enjoy
P.S When it doubt, call the magic powers of source forge.
Oh yeah, and of course SharpDevelop [1]
[1] http://www.icsharpcode.net/OpenSource/SD/While I don't know about the actual code quality, you can have a look at the .NET Framework itself. At least they have FxCop and StyleCop running against it, since that's what the two tools were made for.
Visual Studio allows stepping into the BCL source, and there are some tools that misuse this functionality to download the entire source code. You can also look into the code with Reflector, since it is not obfuscated.
Nunit [1] and Lucene.net [2]
[1] http://www.nunit.org/index.php