in Uncategorized

Build PDB Information For Release Builds Using An Upgraded nAnt Solution Task

I’m sure we all know the advantages of having PDB information for our release builds by now, right? Well nAnt’s <solution> task doesn’t support this today because it only supports the same features as VS.NET which only use the compiler’s /debug switch with the +|- options. The .NET 1.1 version of the managed code compilers introduced new /debug switch settings: full and pdbonly. My solution to this problem was to extend the existing <solution> task, which is implemented mainly in SolutionBase.cs, with a new (optional) attribute called “projectDebugMode” which accepts the following three values: “useConfiguration” (the default for backwards compatibility), “full” and “pdbOnly”.

Next, to get the projects to actually use this new attribute, I had to dig around in the logic that loads project configuration. It turns out this is implemented in ConfigurationSettings.cs and sure enough the existing logic there is only mirroring the +|- support that VS.NET provides. So with only a few minor changes to the interpretation of the DebugSymbols project configuration setting, things work just as desired. Here’s what a build script might look like:

<solution solutionfile="mySolution.sln" configuration="{$buildConfigurationName}" projectDebugMode="{$projectDebugMode}">
     <!-- my projects here -->
</solution>

I have supplied the changes back to the nAnt project, but I don’t know if they’ll approve them or when they’ll have time to incorporate them. If you’d like to take advantage of this feature today, I’m supplying the updates source code for the files I mentioned over here.

Leave a comment

Comment

  • Related Content by Tag