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.

at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at NAnt.Core.ProjectSettingsLoader.ProcessSettings(XmlNode nantNode) in c:\Documents and Settings\Administrator\Local Settings\Temp\tmp380.tmp\src\NAnt.Core\ProjectSettingsLoader.cs:line 106
at NAnt.Core.Project.CtorHelper(XmlDocument doc, Level threshold, Int32 indentLevel) in c:\Documents and Settings\Administrator\Local Settings\Temp\tmp380.tmp\src\NAnt.Core\Project.cs:line 1136
at NAnt.Core.Project..ctor(String uriOrFilePath, Level threshold, Int32 indentLevel) in c:\Documents and Settings\Administrator\Local Settings\Temp\tmp380.tmp\src\NAnt.Core\Project.cs:line 226
at NAnt.Core.Project..ctor(String uriOrFilePath, Level threshold) in c:\Documents and Settings\Administrator\Local Settings\Temp\tmp380.tmp\src\NAnt.Core\Project.cs:line 192
at NAnt.Contrib.NAntAddin.BuildExecutor.Run() in c:\nant-contrib\tools\vsnetaddin\nantaddin.cs:line 1455

 

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);

                  }

            }

      }

                       

 

 

Go Hokies!!

 

Craig Eddy

8685 Nagle St.
Manassas, VA 20110

[EMAIL PROTECTED]
http://www.craigeddy.net

tel:
fax:
mobile:

703-369-4512
866-313-2958
703-994-0260

 

Powered by Plaxo

Want a signature like this?

Add me to your address book...

 

Reply via email to