In NAntAddin.cs, I cannot compile the following line:
if (configNodes.Count > 0)
{
nAntProject.ProcessSettings(configNodes [0]);
} Because NAnt.Core.Project lacks a ProcessSettings method. Also, if I comment this out and compile, an exception is
generated when I try to execute a target (the exception occurs prior to the
comment-out code): Index (zero based)
must be greater than or equal to zero and less than the size of the argument
list. I placed a try/catch/finally around most of this method in
order to see this message. Prior to doing so I think VS.NET was eating the
exception and unloading the add-in. Here’s the code I added (which
accounts for the skewed line number of the last entry in the stack trace
above):
public void Run()
{
Monitor.Enter(addin.buildingMonitor);
try
{ <…>
addin.building = false;
}
catch( Exception ex )
{
buildOutputWindow.OutputString(
"\n\n---------------------- Exception ----------------------\n");
buildOutputWindow.OutputString(
"\n" + ex.Message);
buildOutputWindow.OutputString(
"\n" + ex.StackTrace);
}
finally
{
Monitor.Exit(addin.buildingMonitor);
}
}
}
|