Archives
-
C# 101 - Representing a double quote in string literals
I'm sure almost every C# developer already knew this, but I thought a post might help the few that didn't. I had always wondered how it was done and stumbled across it yesterday buried in an example in the C# Language Specification.
-
Invoking different NAnt targets on different versions of Windows
A friend just asked me how to invoke different targets for different versions of Windows using NAnt 0.84. At first I told him to start using NAnt 0.85 so he could use the new string comparison functions, but as I thought about it more, I realized that it's not hard to do without resorting to functions, the following will work fine in either version of NAnt:
-
A better way to set the version into the VersionInfo.cs file
In my previous post I mentioned that I had written my own <setversion> task to set the file version number in the centralized VersionInfo.cs. I took another look at NAnt's built in tasks, and <asminfo> does exactly what I need. I just changed the NAnt build script to write out VersionInfo.cs like this:
-
Versioning Groups of Assemblies in sync
We often build groups of assemblies that all need to be marked with the same build number. Rather than having the build check out a whole bunch of AssemblyInfo.cs files from source control, set their file versions, and check them in, we use Visual Studio .NET's handy and (not widely known) Linked file feature to centralize the version information into a single file. Then the build only has to worry about updating the build number in one place. Here's how we do it.
-
Forehead slapper on DateTime.AddDays()
I should have read the documentation for DateTime.AddDays() a little more carefully. This one caused a minor bug for me this week: