Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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

share|improve this answer

Have you performed authorization? Otherwise, license binding will fail

You can see if your software is authorized in ArcGIS Administrator

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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