2

I installed the ArcOjbects SDK (if I remember correctly) and in visual studio I have referenced the needed assemblies. Namely ESRI.ArcGIS.Geoprocessor.

When in stepping through in debug mode I hit this routine:

void BindingArcGISRuntime(object sender, EventArgs e)
        {

            //ProductCode[] supportedRuntimes = new ProductCode[] { ProductCode.Desktop };
            //foreach (ProductCode c in supportedRuntimes)
            //{
            //    if (RuntimeManager.Bind(c))
            //        return;
            //}


            if (!RuntimeManager.Bind(ProductCode.Desktop))
            {
                // Failed to bind, announce and force exit
                Console.WriteLine("Invalid ArcGIS runtime binding. Application will shut down.");
                System.Environment.Exit(0);
            }
        }

But I don't hit the

"Console.WriteLine("Invalid ArcGIS runtime binding. Application will shut down.");"

piece

Then straight to this auto-generated routine:

if (RuntimeManager.ActiveRuntime == null)
            {
                EventHandler temp = ResolveBindingEvent;
                if (temp != null)
                {
                    temp(this, new EventArgs());
                }
            }

            return Initialize();

Any ideas? Thanks.

1

Have you performed authorization? Otherwise, license binding will fail

You can see if your software is authorized in ArcGIS Administrator

1

i think you should drag the licence key into a window, and copy this code in program.cs

    using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using ESRI.ArcGIS;

namespace Geoleve
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {

            if (!RuntimeManager.Bind(ProductCode.Engine))
            {
                if (!RuntimeManager.Bind(ProductCode.Desktop))
                {
                    MessageBox.Show("Unable to bind to ArcGIS runtime. Application will be shut down.");
                    return;
                }
            }


            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}

if you are using .NET framework 3.5 in 64 bits machine you may have another error and here the solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.