Monthly Archives: May 2011

Iterate folders non-recursively

Here are a few methods to help iterate complete directory trees and the files in them without using recursive method calls. The directories are read one at a time to keep memory usage at a minimum. These restrictions enables iterating trees in very large file shares. static IEnumerable<string> GetDirectories(string startDirectory) { var dirsToVisit = new Stack<string>(); [...]

NLog configuration file

I often use NLog for diagnostic tracing in e.g. services. NLog is very much like log4net (log4j for .net) except that it is still being maintained, was written for .NET and features a very flexible end extensible logging framework. See also the post about interceptors. This is an example of a nlog.config I recently used [...]

Return value missing from xml doc

I recently used Oleg Tkachenko’s nice (and old) MultiOutTransform to generate HTML documentation for a little C# project. It was important that the documentation was always updated, so I checked the “XML documentation file” project setting and added a call to MultiOutTransform in the post build event. There is a small, but quite imporant thing [...]

Follow

Get every new post delivered to your Inbox.