Execute Custom Tool--Obeject Reference Not Set for instance of Object

Discussion created by agslayton on Apr 22, 2011
Latest reply on Apr 26, 2011 by agslayton
I am trying to execute a custom tool (python script) from ArcObjects program.  The function works fine when I try the code with a system tool (e.g. the Buffer tool from analysis toolbox), but always get "Object Reference not set for instance of Object" with the custom tool.  See below for code listing of relevant function.  Any thoughts?

private void button2_Click(object sender, EventArgs e)
                IGeoProcessor2 gp = new GeoProcessorClass();
                MessageBox.Show("Hello with AGS toolbox set.");
                gp.Execute("hello", null, null);

                // Create the geoprocessor.
                //IGeoProcessor2 gp = new GeoProcessorClass();

                // Create an IVariantArray to hold the parameter values.
                //IVariantArray parameters = new VarArrayClass();

                // Populate the variant array with parameter values.
                //parameters.Add("1000 Meters");

                // Execute the tool.
                //gp.Execute("Buffer_analysis", parameters, null);


            catch (System.Exception ex)